diff --git a/SOURCES/0001-sidebar-thumbnails-fix-clunky-scrolling.patch b/SOURCES/0001-sidebar-thumbnails-fix-clunky-scrolling.patch new file mode 100644 index 0000000..f1cb117 --- /dev/null +++ b/SOURCES/0001-sidebar-thumbnails-fix-clunky-scrolling.patch @@ -0,0 +1,82 @@ +From 6480c7039bdf7e8f15f7d1415460db255910c40b Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Nelson=20Ben=C3=ADtez=20Le=C3=B3n?= + +Date: Sun, 28 May 2017 22:35:05 +0500 +Subject: [PATCH] sidebar-thumbnails: fix clunky scrolling + +Caused by GtkIconView doing an invalidate and relayout of *all* +items in the view anytime we update model data in any indiviual +item (which happens with all the items that are getting in and out +of the scrolling area while we scroll). This caused GtkIconView to +machine-gunned us with "size-allocate" signals, a signal we were +using to update thumbnails when the sidebar is resized. + +Fixed by connecting to the GtkTreeModel "row-changed" signal before +GtkIconView does it, and stop emission from there. + +As we don't depend now on "size-allocate" signals to show thumbnails +while we scroll, just queue a draw on the icon view when a +thumbnail finish rendering. + +Thanks Jose Aliste for first spotting the problem. + +https://bugzilla.gnome.org/show_bug.cgi?id=691448 +--- + shell/ev-sidebar-thumbnails.c | 24 ++++++++++++++++++++++++ + 1 file changed, 24 insertions(+) + +diff --git a/shell/ev-sidebar-thumbnails.c b/shell/ev-sidebar-thumbnails.c +index 253eabf..c22e92e 100644 +--- a/shell/ev-sidebar-thumbnails.c ++++ b/shell/ev-sidebar-thumbnails.c +@@ -802,9 +802,26 @@ ev_sidebar_thumbnails_device_scale_factor_changed_cb (EvSidebarThumbnails *sideb + } + + static void ++ev_sidebar_thumbnails_row_changed (GtkTreeModel *model, ++ GtkTreePath *path, ++ GtkTreeIter *iter, ++ gpointer data) ++{ ++ guint signal_id; ++ ++ signal_id = GPOINTER_TO_UINT (data); ++ ++ /* PREVENT GtkIconView "row-changed" handler to be reached, as it will ++ * perform a full invalidate and relayout of all items, See bug: ++ * https://bugzilla.gnome.org/show_bug.cgi?id=691448#c9 */ ++ g_signal_stop_emission (model, signal_id, 0); ++} ++ ++static void + ev_sidebar_thumbnails_init (EvSidebarThumbnails *ev_sidebar_thumbnails) + { + EvSidebarThumbnailsPrivate *priv; ++ guint signal_id; + + priv = ev_sidebar_thumbnails->priv = EV_SIDEBAR_THUMBNAILS_GET_PRIVATE (ev_sidebar_thumbnails); + +@@ -814,6 +831,11 @@ ev_sidebar_thumbnails_init (EvSidebarThumbnails *ev_sidebar_thumbnails) + G_TYPE_BOOLEAN, + EV_TYPE_JOB_THUMBNAIL); + ++ signal_id = g_signal_lookup ("row-changed", GTK_TYPE_TREE_MODEL); ++ g_signal_connect (GTK_TREE_MODEL (priv->list_store), "row-changed", ++ G_CALLBACK (ev_sidebar_thumbnails_row_changed), ++ GUINT_TO_POINTER (signal_id)); ++ + priv->swindow = gtk_scrolled_window_new (NULL, NULL); + + gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (priv->swindow), +@@ -962,6 +984,8 @@ thumbnail_job_completed_callback (EvJobThumbnail *job, + COLUMN_JOB, NULL, + -1); + cairo_surface_destroy (surface); ++ ++ gtk_widget_queue_draw (priv->icon_view); + } + + static void +-- +2.9.4 + diff --git a/SPECS/evince.spec b/SPECS/evince.spec index 307d0da..cc7a943 100644 --- a/SPECS/evince.spec +++ b/SPECS/evince.spec @@ -5,7 +5,7 @@ Name: evince Version: 3.22.1 -Release: 5.2%{?dist} +Release: 7%{?dist} Summary: Document viewer License: GPLv2+ and GPLv3+ and LGPLv2+ and MIT and Afmparse @@ -22,8 +22,10 @@ Patch3: 0001-Resolves-deb-762530-rhbz-1061177-add-man-pages.patch Patch4: 0001-Resolves-rhbz-1358249-page-up-down.patch Patch5: 0001-Revert-Bump-poppler-requirements-to-0.33.0.patch # https://bugzilla.redhat.com/show_bug.cgi?id=1468488 -# https://bugzilla.redhat.com/show_bug.cgi?id=1469528 +# https://bugzilla.redhat.com/show_bug.cgi?id=1469529 Patch6: 0001-comics-Remove-support-for-tar-and-tar-like-commands.patch +# https://bugzilla.redhat.com/show_bug.cgi?id=1462778 +Patch7: 0001-sidebar-thumbnails-fix-clunky-scrolling.patch BuildRequires: pkgconfig(adwaita-icon-theme) BuildRequires: pkgconfig(gio-unix-2.0) >= %{glib2_version} @@ -134,6 +136,7 @@ This package contains the evince web browser plugin. %patch4 -p1 -b .rhbz-1358249-page-up-down %patch5 -p1 -b .poppler-requirements %patch6 -p1 -b .no-tar +%patch7 -p1 -b .fix-clunky-scrolling %build autoreconf -f -i @@ -277,13 +280,13 @@ glib-compile-schemas %{_datadir}/glib-2.0/schemas >&/dev/null ||: %{_libdir}/mozilla/plugins/libevbrowserplugin.so %changelog -* Mon Jul 17 2017 Caolán McNamara - 3.22.1-5.2 -- Related: #1469528 ensure .desktop file is still valid +* Mon Aug 14 2017 Caolán McNamara - 3.22.1-7 +- Resolves: rhbz#1462778 Page thumbnails disappear after "Inverted Colors" -* Fri Jul 07 2017 Bastien Nocera - 3.22.1-5.1 +* Fri Jul 07 2017 Bastien Nocera - 3.22.1-6 + Fix arbitrary code execution via filename in tar-compressed comics archive -- Resolves: #1469528 +- Resolves: #1469529 * Mon Jan 16 2017 Caolán McNamara - 3.22.1-5 - Resolves: rhbz#1358249 restore ctrl page up/down shortcuts