# HG changeset patch # User nadvornik # Date 1245590882 0 # Node ID 71b29f70d08ca7082a39a0d9ce6891d4f17f211a # Parent 98cd4f700f355f82b16c9b0da5230b8894dacec2 fixed jumping of filelist on focus_in event diff -r 98cd4f700f35 -r 71b29f70d08c src/layout_image.c --- 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); } } diff -r 98cd4f700f35 -r 71b29f70d08c src/layout_image.h --- 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);