Fix runtime critical warning when starting in fullscreen mode

This commit is contained in:
Marek Kasik 2014-11-05 12:34:12 +01:00
parent bad7e33a81
commit 61df36932a
2 changed files with 43 additions and 1 deletions

View File

@ -0,0 +1,36 @@
From 8875003da7f78a6fbba36fcc70d6ed2d372da7a6 Mon Sep 17 00:00:00 2001
From: Carlos Garcia Campos <carlosgc@gnome.org>
Date: Sun, 19 Oct 2014 16:01:38 +0200
Subject: [PATCH] Fix runtime critical warning when starting in fullscreen mode
The problem is that when running fullscreen mode we call
ev_window_update_links_model() to update the page action widget of the
fullscreen toolbar, but when running directly in fullscreen mode, this
can happen before the links have been loaded in the sidebar. Since
ev_window_update_links_model() is also called automatically when the
links model property changes, we can simply return early in
ev_window_update_links_model() when the model is NULL and it will be
called again with a valid model when the links job finishes.
https://bugzilla.gnome.org/show_bug.cgi?id=737864
---
shell/ev-window.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/shell/ev-window.c b/shell/ev-window.c
index 4de4732..e7f6a96 100644
--- a/shell/ev-window.c
+++ b/shell/ev-window.c
@@ -4024,6 +4024,9 @@ ev_window_update_links_model (EvWindow *window)
"model", &model,
NULL);
+ if (!model)
+ return;
+
page_selector = ev_toolbar_get_page_selector (EV_TOOLBAR (window->priv->toolbar));
ev_page_action_widget_update_links_model (EV_PAGE_ACTION_WIDGET (page_selector), model);
if (window->priv->fs_toolbar) {
--
2.1.0

View File

@ -5,7 +5,7 @@
Name: evince
Version: 3.14.1
Release: 2%{?dist}
Release: 3%{?dist}
Summary: Document viewer
License: GPLv2+ and GPLv3+ and LGPLv2+ and MIT and Afmparse
@ -16,6 +16,8 @@ Source0: http://download.gnome.org/sources/%{name}/3.14/%{name}-%{version
# https://bugzilla.redhat.com/show_bug.cgi?id=1160376
Patch0: 0001-Disable-toggle-find-action-for-documents-not-support.patch
Patch1: 0001-Fix-runtime-critical-warning-when-starting-in-fullsc.patch
BuildRequires: glib2-devel >= %{glib2_version}
BuildRequires: gtk3-devel >= %{gtk3_version}
BuildRequires: poppler-glib-devel >= %{poppler_version}
@ -122,6 +124,7 @@ This package contains the evince web browser plugin.
%setup -q
%patch0 -p1 -b .toggle-find
%patch1 -p1 -b .unref
%build
./autogen.sh
@ -250,6 +253,9 @@ glib-compile-schemas %{_datadir}/glib-2.0/schemas >&/dev/null ||:
%{_libdir}/mozilla/plugins/libevbrowserplugin.so
%changelog
* Wed Nov 5 2014 Marek Kasik <mkasik@redhat.com> - 3.14.1-3
- Fix runtime critical warning when starting in fullscreen mode
* Wed Nov 5 2014 Marek Kasik <mkasik@redhat.com> - 3.14.1-2
- Disable toggle-find action for documents not supporting find
- Resolves: #1160376