aboutsummaryrefslogtreecommitdiff
blob: eb33019687c5cf15bfa0af0bea82726c1e201c04 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
From 220956ee03fa37fb55079aff63675db26cd908f9 Mon Sep 17 00:00:00 2001
From: Cristian KLEIN <cristiklein+gnome@gmail.com>
Date: Thu, 16 Dec 2010 17:38:06 +0000
Subject: libview: Stop the GtkSpinner when the loading window is hidden

Fixes bug #637390.
---
diff --git a/libview/ev-loading-window.c b/libview/ev-loading-window.c
index 4d5eaaf..434beac 100644
--- a/libview/ev-loading-window.c
+++ b/libview/ev-loading-window.c
@@ -33,6 +33,7 @@ struct _EvLoadingWindow {
 	GtkWindow  base_instance;
 
 	GtkWindow *parent;
+	GtkWidget *spinner;
 
 	gint       x;
 	gint       y;
@@ -69,7 +70,6 @@ ev_loading_window_init (EvLoadingWindow *window)
 	GtkWindow   *gtk_window = GTK_WINDOW (window);
 	GtkWidget   *widget = GTK_WIDGET (window);
 	GtkWidget   *hbox;
-	GtkWidget   *spinner;
 	GtkWidget   *label;
 	GtkStyle    *style;
 	GdkColor    fg, bg;
@@ -79,10 +79,9 @@ ev_loading_window_init (EvLoadingWindow *window)
 
 	hbox = gtk_hbox_new (FALSE, 12);
 
-	spinner = gtk_spinner_new ();
-	gtk_spinner_start (GTK_SPINNER (spinner));
-	gtk_box_pack_start (GTK_BOX (hbox), spinner, FALSE, FALSE, 0);
-	gtk_widget_show (spinner);
+	window->spinner = gtk_spinner_new ();
+	gtk_box_pack_start (GTK_BOX (hbox), window->spinner, FALSE, FALSE, 0);
+	gtk_widget_show (window->spinner);
 
 	label = gtk_label_new (loading_text);
 	gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
@@ -222,10 +221,22 @@ ev_loading_window_hide (GtkWidget *widget)
 
 	window->x = window->y = 0;
 
+	gtk_spinner_stop (GTK_SPINNER (window->spinner));
+
 	GTK_WIDGET_CLASS (ev_loading_window_parent_class)->hide (widget);
 }
 
 static void
+ev_loading_window_show (GtkWidget *widget)
+{
+	EvLoadingWindow *window = EV_LOADING_WINDOW (widget);
+
+	gtk_spinner_start (GTK_SPINNER (window->spinner));
+
+	GTK_WIDGET_CLASS (ev_loading_window_parent_class)->show (widget);
+}
+
+static void
 ev_loading_window_class_init (EvLoadingWindowClass *klass)
 {
 	GObjectClass   *g_object_class = G_OBJECT_CLASS (klass);
@@ -235,6 +246,7 @@ ev_loading_window_class_init (EvLoadingWindowClass *klass)
 	g_object_class->set_property = ev_loading_window_set_property;
 
 	gtk_widget_class->size_allocate = ev_loading_window_size_allocate;
+	gtk_widget_class->show = ev_loading_window_show;
 	gtk_widget_class->hide = ev_loading_window_hide;
 
 	g_object_class_install_property (g_object_class,
--
cgit v0.9