diff options
author | Nelson Benitez Leon <[email protected]> | 2017-06-04 18:08:29 +0500 |
---|---|---|
committer | raveit65 <[email protected]> | 2017-08-15 14:09:42 +0200 |
commit | 4f39960daadb0a89f752d314b81612dcec5a30c0 (patch) | |
tree | 69ca91e092ebd2301cb26b9105cdd7855dcc7269 | |
parent | c3bc9fa16ddeae691b9154024725dd85d56011d7 (diff) | |
download | atril-4f39960daadb0a89f752d314b81612dcec5a30c0.tar.bz2 atril-4f39960daadb0a89f752d314b81612dcec5a30c0.tar.xz |
sidebar-thumbnails: fix unwanted move to start after fullscreen
After activating or deactivating fullscreen mode, the sidebar
window is automatically moved to its start, while scroll bar
stays in its original position.
The sidebar window move is unwanted and unsolicited, and it's
most probably caused by GtkIconView or GtkScrolledWindow bug.
Workaround this by having the sidebar sync its window with the
current scroll position after a fullscreen operation, do that by
just emitting a "value-changed" on the current scroll adjustment.
https://bugzilla.gnome.org/show_bug.cgi?id=783404
origin commit:
https://git.gnome.org/browse/evince/commit/?id=2bfb8fa
-rw-r--r-- | shell/ev-sidebar-thumbnails.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/shell/ev-sidebar-thumbnails.c b/shell/ev-sidebar-thumbnails.c index 20243e5b..3d17d692 100644 --- a/shell/ev-sidebar-thumbnails.c +++ b/shell/ev-sidebar-thumbnails.c @@ -301,6 +301,23 @@ ev_sidebar_thumbnails_map (GtkWidget *widget) } static void +ev_sidebar_fullscreen_cb (EvSidebarThumbnails *sidebar) +{ + /* After activating or deactivating fullscreen mode, the sidebar + * window is automatically moved to its start, while scroll bar + * stays in its original position. + * + * The sidebar window move is unwanted and unsolicited, and it's + * most probably caused by GtkIconView or GtkScrolledWindow bug. + * + * Workaround this by having the sidebar sync its window with the + * current scroll position after a fullscreen operation, do that by + * just emitting a "value-changed" on the current scroll adjustment. + * Fixes https://bugzilla.gnome.org/show_bug.cgi?id=783404 */ + g_signal_emit_by_name (sidebar->priv->vadjustment, "value-changed"); +} + +static void ev_sidebar_thumbnails_class_init (EvSidebarThumbnailsClass *ev_sidebar_thumbnails_class) { GObjectClass *g_object_class; @@ -955,6 +972,9 @@ ev_sidebar_thumbnails_document_changed_cb (EvDocumentModel *model, g_signal_connect (priv->model, "notify::inverted-colors", G_CALLBACK (ev_sidebar_thumbnails_inverted_colors_changed_cb), sidebar_thumbnails); + g_signal_connect_swapped (priv->model, "notify::fullscreen", + G_CALLBACK (ev_sidebar_fullscreen_cb), + sidebar_thumbnails); sidebar_thumbnails->priv->start_page = -1; sidebar_thumbnails->priv->end_page = -1; ev_sidebar_thumbnails_set_current_page (sidebar_thumbnails, |