changeset 1659:71b29f70d08c

fixed jumping of filelist on focus_in event
author nadvornik
date Sun, 21 Jun 2009 13:28:02 +0000
parents 98cd4f700f35
children da8afd03152f
files src/layout_image.c src/layout_image.h
diffstat 2 files changed, 11 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/src/layout_image.c	Sun Jun 21 12:39:58 2009 +0000
+++ b/src/layout_image.c	Sun Jun 21 13:28:02 2009 +0000
@@ -595,7 +595,7 @@
 	if (i < MAX_SPLIT_IMAGES)
 		{
 		DEBUG_1("dnd image activate %d", i);
-		layout_image_activate(lw, i);
+		layout_image_activate(lw, i, FALSE);
 		}
 
 
@@ -1335,7 +1335,7 @@
 	if (i != -1)
 		{
 		DEBUG_1("image activate focus_in %d", i);
-		layout_image_activate(lw, i);
+		layout_image_activate(lw, i, FALSE);
 		}
 }
 
@@ -1377,7 +1377,7 @@
 	if (i != -1)
 		{
 		DEBUG_1("image activate scroll %d", i);
-		layout_image_activate(lw, i);
+		layout_image_activate(lw, i, FALSE);
 		}
 
 
@@ -1467,7 +1467,7 @@
 
 	if (i != -1)
 		{
-		layout_image_activate(lw, i);
+		layout_image_activate(lw, i, FALSE);
 		}
 
 	switch (event->button)
@@ -1493,7 +1493,7 @@
 
 	if (i != -1)
 		{
-		layout_image_activate(lw, i);
+		layout_image_activate(lw, i, FALSE);
 		}
 
 	/* continue as with active image */
@@ -1631,12 +1631,13 @@
 	image_select(lw->split_images[i], FALSE);
 }
 
-
-void layout_image_activate(LayoutWindow *lw, gint i)
+/* force should be set after change of lw->split_mode */
+void layout_image_activate(LayoutWindow *lw, gint i, gboolean force)
 {
 	FileData *fd;
 
 	if (!lw->split_images[i]) return;
+	if (!force && lw->active_split_image == i) return;
 
 	/* deactivate currently active */
 	if (lw->active_split_image != i)
@@ -1743,13 +1744,13 @@
 	
 	if (!lw->image || lw->active_split_image < 0 || lw->active_split_image >= n)
 		{
-		layout_image_activate(lw, 0);
+		layout_image_activate(lw, 0, TRUE);
 		}
 	else
 		{
 		/* this will draw the frame around selected image (image_select)
 		   on switch from single to split images */
-		layout_image_activate(lw, lw->active_split_image);
+		layout_image_activate(lw, lw->active_split_image, TRUE);
 		}
 }
 
--- a/src/layout_image.h	Sun Jun 21 12:39:58 2009 +0000
+++ b/src/layout_image.h	Sun Jun 21 13:28:02 2009 +0000
@@ -15,7 +15,7 @@
 
 
 GtkWidget *layout_image_new(LayoutWindow *lw, gint i);
-void layout_image_activate(LayoutWindow *lw, gint i);
+void layout_image_activate(LayoutWindow *lw, gint i, gboolean force);
 GtkWidget *layout_image_setup_split_none(LayoutWindow *lw);
 GtkWidget *layout_image_setup_split_hv(LayoutWindow *lw, gboolean horizontal);
 GtkWidget *layout_image_setup_split(LayoutWindow *lw, ImageSplitMode mode);