summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNelson Benitez Leon <[email protected]>2017-06-04 18:08:29 +0500
committerraveit65 <[email protected]>2017-08-15 14:46:29 +0200
commit1aa348016c7e2e609b56e5ef0706871784443f78 (patch)
tree55597dca4b0a1340adb62d1a9ace4430217b464f
parenta128703a550dd27b7ef6085f5af12975e9e20681 (diff)
downloadatril-1aa348016c7e2e609b56e5ef0706871784443f78.tar.bz2
atril-1aa348016c7e2e609b56e5ef0706871784443f78.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.c20
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,