[evince] sidebar-thumbnails: fix unwanted move to start after fullscreen
- From: Nelson Benítez León <nbenitez src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evince] sidebar-thumbnails: fix unwanted move to start after fullscreen
- Date: Mon, 5 Jun 2017 13:31:35 +0000 (UTC)
commit 2bfb8fa7c2b253a2aa3cb161a694b95ef84c4b31
Author: Nelson Benítez León <nbenitezl+gnome gmail com>
Date: Sun Jun 4 18:08:29 2017 +0500
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
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 7822c27..339769c 100644
--- a/shell/ev-sidebar-thumbnails.c
+++ b/shell/ev-sidebar-thumbnails.c
@@ -323,6 +323,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_size_allocate (GtkWidget *widget,
GtkAllocation *allocation)
{
@@ -1051,6 +1068,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,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]