# HG changeset patch # User nadvornik # Date 1245590882 0 # Node ID 7ed0b45c80aeded7d74ffb77391f79ceb4f09c44 # Parent 3968a763e2b18092934aaf639ae4fb166c7210ef fixed jumping of filelist on focus_in event diff -r 3968a763e2b1 -r 7ed0b45c80ae 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 @@ -596,7 +596,7 @@ if (i < MAX_SPLIT_IMAGES) { DEBUG_1("dnd image activate %d", i); - layout_image_activate(lw, i); + layout_image_activate(lw, i, FALSE); } @@ -1338,7 +1338,7 @@ if (i != -1) { DEBUG_1("image activate focus_in %d", i); - layout_image_activate(lw, i); + layout_image_activate(lw, i, FALSE); } } @@ -1380,7 +1380,7 @@ if (i != -1) { DEBUG_1("image activate scroll %d", i); - layout_image_activate(lw, i); + layout_image_activate(lw, i, FALSE); } @@ -1470,7 +1470,7 @@ if (i != -1) { - layout_image_activate(lw, i); + layout_image_activate(lw, i, FALSE); } switch (event->button) @@ -1496,7 +1496,7 @@ if (i != -1) { - layout_image_activate(lw, i); + layout_image_activate(lw, i, FALSE); } /* continue as with active image */ @@ -1633,12 +1633,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) @@ -1745,13 +1746,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 3968a763e2b1 -r 7ed0b45c80ae 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);