|
|
eb855a |
From ca83dd9054abdaae93308f27bdf927e050230027 Mon Sep 17 00:00:00 2001
|
|
|
eb855a |
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
|
|
|
eb855a |
Date: Tue, 10 Jan 2017 12:04:58 +0000
|
|
|
eb855a |
Subject: [PATCH] Resolves: rhbz#1404656 crash on opening second evince window
|
|
|
eb855a |
|
|
|
eb855a |
e.g.
|
|
|
eb855a |
|
|
|
eb855a |
export G_SLICE=always-malloc
|
|
|
eb855a |
open https://www.antennahouse.com/XSLsample/pdf/sample-link_1.pdf
|
|
|
eb855a |
right click on the first link and open in new window
|
|
|
eb855a |
close the new window
|
|
|
eb855a |
repeat
|
|
|
eb855a |
crash
|
|
|
eb855a |
|
|
|
eb855a |
This is similar to https://bugzilla.gnome.org/show_bug.cgi?id=726812
|
|
|
eb855a |
---
|
|
|
eb855a |
shell/ev-window.c | 34 ++++++++++++++++++++++++----------
|
|
|
eb855a |
1 file changed, 24 insertions(+), 10 deletions(-)
|
|
|
eb855a |
|
|
|
eb855a |
diff --git a/shell/ev-window.c b/shell/ev-window.c
|
|
|
eb855a |
index 11f2fd5..a648ed7 100644
|
|
|
eb855a |
--- a/shell/ev-window.c
|
|
|
eb855a |
+++ b/shell/ev-window.c
|
|
|
eb855a |
@@ -6666,10 +6666,32 @@ _gtk_css_provider_load_from_resource (GtkCssProvider *provider,
|
|
|
eb855a |
}
|
|
|
eb855a |
|
|
|
eb855a |
static void
|
|
|
eb855a |
+ev_window_init_css (void)
|
|
|
eb855a |
+{
|
|
|
eb855a |
+ static gsize initialization_value = 0;
|
|
|
eb855a |
+
|
|
|
eb855a |
+ if (g_once_init_enter (&initialization_value)) {
|
|
|
eb855a |
+ GtkCssProvider *css_provider;
|
|
|
eb855a |
+ GError *error = NULL;
|
|
|
eb855a |
+
|
|
|
eb855a |
+ css_provider = gtk_css_provider_new ();
|
|
|
eb855a |
+ _gtk_css_provider_load_from_resource (css_provider,
|
|
|
eb855a |
+ "/org/gnome/evince/ui/evince.css",
|
|
|
eb855a |
+ &error);
|
|
|
eb855a |
+ g_assert_no_error (error);
|
|
|
eb855a |
+ gtk_style_context_add_provider_for_screen (gdk_screen_get_default (),
|
|
|
eb855a |
+ GTK_STYLE_PROVIDER (css_provider),
|
|
|
eb855a |
+ GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
|
|
|
eb855a |
+ g_object_unref (css_provider);
|
|
|
eb855a |
+
|
|
|
eb855a |
+ g_once_init_leave (&initialization_value, 1);
|
|
|
eb855a |
+ }
|
|
|
eb855a |
+}
|
|
|
eb855a |
+
|
|
|
eb855a |
+static void
|
|
|
eb855a |
ev_window_init (EvWindow *ev_window)
|
|
|
eb855a |
{
|
|
|
eb855a |
GtkBuilder *builder;
|
|
|
eb855a |
- GtkCssProvider *css_provider;
|
|
|
eb855a |
GError *error = NULL;
|
|
|
eb855a |
GtkWidget *sidebar_widget;
|
|
|
eb855a |
GtkWidget *overlay;
|
|
|
eb855a |
@@ -6748,15 +6770,7 @@ ev_window_init (EvWindow *ev_window)
|
|
|
eb855a |
actions, G_N_ELEMENTS (actions),
|
|
|
eb855a |
ev_window);
|
|
|
eb855a |
|
|
|
eb855a |
- css_provider = gtk_css_provider_new ();
|
|
|
eb855a |
- _gtk_css_provider_load_from_resource (css_provider,
|
|
|
eb855a |
- "/org/gnome/evince/ui/evince.css",
|
|
|
eb855a |
- &error);
|
|
|
eb855a |
- g_assert_no_error (error);
|
|
|
eb855a |
- gtk_style_context_add_provider_for_screen (gtk_widget_get_screen (GTK_WIDGET (ev_window)),
|
|
|
eb855a |
- GTK_STYLE_PROVIDER (css_provider),
|
|
|
eb855a |
- GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
|
|
|
eb855a |
- g_object_unref (css_provider);
|
|
|
eb855a |
+ ev_window_init_css ();
|
|
|
eb855a |
|
|
|
eb855a |
ev_window->priv->recent_manager = gtk_recent_manager_get_default ();
|
|
|
eb855a |
|
|
|
eb855a |
--
|
|
|
eb855a |
2.9.3
|
|
|
eb855a |
|