- Don't crash when closing spatial window very quickly after opening it
(gnome bug 552859)
This commit is contained in:
parent
0632f6a573
commit
29fb407f2f
@ -107,6 +107,45 @@ diff --git a/eel/eel-background.c b/eel/eel-background.c
|
||||
|
||||
if (pixmap) {
|
||||
|
||||
============================================================
|
||||
Store widget in background details
|
||||
|
||||
It will get used in various places, so keeping
|
||||
|
||||
diff --git a/eel/eel-background.c b/eel/eel-background.c
|
||||
--- a/eel/eel-background.c
|
||||
+++ b/eel/eel-background.c
|
||||
@@ -74,6 +74,7 @@ struct EelBackgroundDetails {
|
||||
char *color;
|
||||
|
||||
GnomeBG *bg;
|
||||
+ GtkWidget *widget;
|
||||
|
||||
/* Realized data: */
|
||||
gboolean background_changes_with_size;
|
||||
@@ -806,6 +807,12 @@ eel_background_is_desktop (EelBackground *background)
|
||||
return background->details->is_desktop;
|
||||
}
|
||||
|
||||
+static void
|
||||
+on_widget_destroyed (GtkWidget *widget, EelBackground *background)
|
||||
+{
|
||||
+ background->details->widget = NULL;
|
||||
+}
|
||||
+
|
||||
/* Gets the background attached to a widget.
|
||||
|
||||
If the widget doesn't already have a EelBackground object,
|
||||
@@ -841,6 +848,8 @@ eel_get_widget_background (GtkWidget *widget)
|
||||
gtk_object_sink (GTK_OBJECT (background));
|
||||
g_object_set_data_full (G_OBJECT (widget), "eel_background",
|
||||
background, g_object_unref);
|
||||
+ background->details->widget = widget;
|
||||
+ g_signal_connect_object (widget, "destroy", G_CALLBACK (on_widget_destroyed), background, 0);
|
||||
|
||||
/* Arrange to get the signal whenever the background changes. */
|
||||
g_signal_connect_object (background, "appearance_changed",
|
||||
|
||||
============================================================
|
||||
Compress multiple background change requests into 1
|
||||
|
||||
@ -119,7 +158,7 @@ the work to an idle handler.
|
||||
diff --git a/eel/eel-background.c b/eel/eel-background.c
|
||||
--- a/eel/eel-background.c
|
||||
+++ b/eel/eel-background.c
|
||||
@@ -90,6 +90,7 @@ struct EelBackgroundDetails {
|
||||
@@ -91,6 +90,7 @@ struct EelBackgroundDetails {
|
||||
gulong screen_size_handler;
|
||||
/* Can we use common pixmap for root window and desktop window */
|
||||
gboolean use_common_pixmap;
|
||||
@ -127,26 +166,28 @@ diff --git a/eel/eel-background.c b/eel/eel-background.c
|
||||
};
|
||||
|
||||
static void
|
||||
@@ -701,13 +702,35 @@ eel_background_set_up_widget (EelBackground *background, GtkWidget *widget)
|
||||
@@ -702,13 +702,35 @@ eel_background_set_up_widget (EelBackground *background, GtkWidget *widget)
|
||||
}
|
||||
}
|
||||
|
||||
-static void
|
||||
-eel_widget_background_changed (GtkWidget *widget, EelBackground *background)
|
||||
+static gboolean
|
||||
+on_background_changed (GtkWidget *widget)
|
||||
+on_background_changed (EelBackground *background)
|
||||
{
|
||||
+ EelBackground *background;
|
||||
+
|
||||
+ background = eel_get_widget_background (widget);
|
||||
+ if (background->details->change_idle_id == 0) {
|
||||
+ return FALSE;
|
||||
+ }
|
||||
+
|
||||
+ background->details->change_idle_id = 0;
|
||||
+
|
||||
eel_background_unrealize (background);
|
||||
eel_background_set_up_widget (background, widget);
|
||||
|
||||
gtk_widget_queue_draw (widget);
|
||||
- eel_background_set_up_widget (background, widget);
|
||||
+ eel_background_set_up_widget (background, background->details->widget);
|
||||
+
|
||||
+ gtk_widget_queue_draw (background->details->widget);
|
||||
|
||||
- gtk_widget_queue_draw (widget);
|
||||
+ return FALSE;
|
||||
+}
|
||||
+
|
||||
@ -161,11 +202,11 @@ diff --git a/eel/eel-background.c b/eel/eel-background.c
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ background->details->change_idle_id = g_idle_add ((GSourceFunc) on_background_changed, widget);
|
||||
+ background->details->change_idle_id = g_idle_add ((GSourceFunc) on_background_changed, background);
|
||||
}
|
||||
|
||||
/* Callback used when the style of a widget changes. We have to regenerate its
|
||||
@@ -720,7 +743,7 @@ widget_style_set_cb (GtkWidget *widget, GtkStyle *previous_style, gpointer data)
|
||||
@@ -721,7 +743,7 @@ widget_style_set_cb (GtkWidget *widget, GtkStyle *previous_style, gpointer data)
|
||||
|
||||
background = EEL_BACKGROUND (data);
|
||||
|
||||
@ -174,7 +215,19 @@ diff --git a/eel/eel-background.c b/eel/eel-background.c
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -844,8 +867,8 @@ eel_get_widget_background (GtkWidget *widget)
|
||||
@@ -810,6 +832,11 @@ eel_background_is_desktop (EelBackground *background)
|
||||
static void
|
||||
on_widget_destroyed (GtkWidget *widget, EelBackground *background)
|
||||
{
|
||||
+ if (background->details->change_idle_id != 0) {
|
||||
+ g_source_remove (background->details->change_idle_id);
|
||||
+ background->details->change_idle_id = 0;
|
||||
+ }
|
||||
+
|
||||
background->details->widget = NULL;
|
||||
}
|
||||
|
||||
@@ -853,8 +880,8 @@ eel_get_widget_background (GtkWidget *widget)
|
||||
|
||||
/* Arrange to get the signal whenever the background changes. */
|
||||
g_signal_connect_object (background, "appearance_changed",
|
||||
@ -186,36 +239,6 @@ diff --git a/eel/eel-background.c b/eel/eel-background.c
|
||||
g_signal_connect_object (widget, "style_set",
|
||||
G_CALLBACK (widget_style_set_cb),
|
||||
|
||||
============================================================
|
||||
Store widget in background details
|
||||
|
||||
It will get used in various places, so keeping
|
||||
it around simplifies things. Note, backgrounds
|
||||
are already tied to the lifetime of their widgets
|
||||
by a g_object_set_data_full call, so we don't need
|
||||
to worry about nullifying the assignment later,
|
||||
or taking a reference.
|
||||
|
||||
diff --git a/eel/eel-background.c b/eel/eel-background.c
|
||||
--- a/eel/eel-background.c
|
||||
+++ b/eel/eel-background.c
|
||||
@@ -74,6 +74,7 @@ struct EelBackgroundDetails {
|
||||
char *color;
|
||||
|
||||
GnomeBG *bg;
|
||||
+ GtkWidget *widget;
|
||||
|
||||
/* Realized data: */
|
||||
gboolean background_changes_with_size;
|
||||
@@ -864,6 +865,7 @@ eel_get_widget_background (GtkWidget *widget)
|
||||
gtk_object_sink (GTK_OBJECT (background));
|
||||
g_object_set_data_full (G_OBJECT (widget), "eel_background",
|
||||
background, g_object_unref);
|
||||
+ background->details->widget = widget;
|
||||
|
||||
/* Arrange to get the signal whenever the background changes. */
|
||||
g_signal_connect_object (background, "appearance_changed",
|
||||
|
||||
============================================================
|
||||
Add the crossfade transition
|
||||
|
||||
@ -223,7 +246,7 @@ diff --git a/eel/eel-background.c b/eel/eel-background.c
|
||||
diff --git a/eel/eel-background.c b/eel/eel-background.c
|
||||
--- a/eel/eel-background.c
|
||||
+++ b/eel/eel-background.c
|
||||
@@ -54,6 +54,9 @@ static GdkPixmap *eel_background_get_pixmap_and_color (EelBackground *backg
|
||||
@@ -53,6 +53,9 @@ static GdkPixmap *eel_background_get_pixmap_and_color (EelBackground *backg
|
||||
gboolean *changes_with_size);
|
||||
static void set_image_properties (EelBackground *background);
|
||||
|
||||
@ -233,7 +256,7 @@ diff --git a/eel/eel-background.c b/eel/eel-background.c
|
||||
EEL_CLASS_BOILERPLATE (EelBackground, eel_background, GTK_TYPE_OBJECT)
|
||||
|
||||
enum {
|
||||
@@ -79,6 +82,7 @@ struct EelBackgroundDetails {
|
||||
@@ -78,6 +81,7 @@ struct EelBackgroundDetails {
|
||||
/* Realized data: */
|
||||
gboolean background_changes_with_size;
|
||||
GdkPixmap *background_pixmap;
|
||||
@ -241,7 +264,7 @@ diff --git a/eel/eel-background.c b/eel/eel-background.c
|
||||
int background_entire_width;
|
||||
int background_entire_height;
|
||||
GdkColor default_color;
|
||||
@@ -140,6 +144,7 @@ eel_background_class_init (gpointer klass)
|
||||
@@ -139,6 +143,7 @@ eel_background_class_init (gpointer klass)
|
||||
static void
|
||||
on_bg_changed (GnomeBG *bg, EelBackground *background)
|
||||
{
|
||||
@ -249,7 +272,7 @@ diff --git a/eel/eel-background.c b/eel/eel-background.c
|
||||
g_signal_emit (G_OBJECT (background),
|
||||
signals[APPEARANCE_CHANGED], 0);
|
||||
}
|
||||
@@ -147,6 +152,7 @@ on_bg_changed (GnomeBG *bg, EelBackground *background)
|
||||
@@ -146,6 +151,7 @@ on_bg_changed (GnomeBG *bg, EelBackground *background)
|
||||
static void
|
||||
on_bg_transitioned (GnomeBG *bg, EelBackground *background)
|
||||
{
|
||||
@ -257,7 +280,7 @@ diff --git a/eel/eel-background.c b/eel/eel-background.c
|
||||
g_signal_emit (G_OBJECT (background),
|
||||
signals[APPEARANCE_CHANGED], 0);
|
||||
}
|
||||
@@ -186,6 +192,15 @@ eel_background_remove_current_image (EelBackground *background)
|
||||
@@ -185,6 +191,15 @@ eel_background_remove_current_image (EelBackground *background)
|
||||
}
|
||||
|
||||
static void
|
||||
@ -273,7 +296,7 @@ diff --git a/eel/eel-background.c b/eel/eel-background.c
|
||||
eel_background_finalize (GObject *object)
|
||||
{
|
||||
EelBackground *background;
|
||||
@@ -200,6 +215,8 @@ eel_background_finalize (GObject *object)
|
||||
@@ -199,6 +214,8 @@ eel_background_finalize (GObject *object)
|
||||
background->details->background_pixmap = NULL;
|
||||
}
|
||||
|
||||
@ -282,7 +305,7 @@ diff --git a/eel/eel-background.c b/eel/eel-background.c
|
||||
g_free (background->details);
|
||||
|
||||
EEL_CALL_PARENT (G_OBJECT_CLASS, finalize, (object));
|
||||
@@ -649,6 +666,33 @@ set_root_pixmap (EelBackground *background,
|
||||
@@ -648,6 +665,33 @@ set_root_pixmap (EelBackground *background,
|
||||
g_object_unref (root_pixmap);
|
||||
}
|
||||
|
||||
@ -316,7 +339,7 @@ diff --git a/eel/eel-background.c b/eel/eel-background.c
|
||||
static void
|
||||
eel_background_set_up_widget (EelBackground *background, GtkWidget *widget)
|
||||
{
|
||||
@@ -661,6 +705,7 @@ eel_background_set_up_widget (EelBackground *background, GtkWidget *widget)
|
||||
@@ -660,6 +704,7 @@ eel_background_set_up_widget (EelBackground *background, GtkWidget *widget)
|
||||
|
||||
GdkWindow *window;
|
||||
gboolean changes_with_size;
|
||||
@ -324,7 +347,7 @@ diff --git a/eel/eel-background.c b/eel/eel-background.c
|
||||
|
||||
if (!GTK_WIDGET_REALIZED (widget)) {
|
||||
return;
|
||||
@@ -683,18 +728,25 @@ eel_background_set_up_widget (EelBackground *background, GtkWidget *widget)
|
||||
@@ -682,18 +727,25 @@ eel_background_set_up_widget (EelBackground *background, GtkWidget *widget)
|
||||
window = widget->window;
|
||||
}
|
||||
|
||||
@ -352,16 +375,7 @@ diff --git a/eel/eel-background.c b/eel/eel-background.c
|
||||
set_root_pixmap (background, window);
|
||||
}
|
||||
|
||||
@@ -707,7 +759,7 @@ static gboolean
|
||||
on_background_changed (GtkWidget *widget)
|
||||
{
|
||||
EelBackground *background;
|
||||
-
|
||||
+
|
||||
background = eel_get_widget_background (widget);
|
||||
|
||||
background->details->change_idle_id = 0;
|
||||
@@ -721,10 +773,40 @@ on_background_changed (GtkWidget *widget)
|
||||
@@ -720,6 +772,36 @@ on_background_changed (EelBackground *background)
|
||||
}
|
||||
|
||||
static void
|
||||
@ -398,8 +412,3 @@ diff --git a/eel/eel-background.c b/eel/eel-background.c
|
||||
eel_widget_queue_background_change (GtkWidget *widget)
|
||||
{
|
||||
EelBackground *background;
|
||||
-
|
||||
+
|
||||
background = eel_get_widget_background (widget);
|
||||
|
||||
if (background->details->change_idle_id > 0) {
|
||||
|
45
nautilus-2.25.2-fix-crasher.patch
Normal file
45
nautilus-2.25.2-fix-crasher.patch
Normal file
@ -0,0 +1,45 @@
|
||||
diff -up nautilus-2.25.2/src/nautilus-window-slot.c.fix-crasher nautilus-2.25.2/src/nautilus-window-slot.c
|
||||
--- nautilus-2.25.2/src/nautilus-window-slot.c.fix-crasher 2009-01-07 14:19:02.542397115 -0500
|
||||
+++ nautilus-2.25.2/src/nautilus-window-slot.c 2009-01-07 14:15:25.815412326 -0500
|
||||
@@ -570,6 +570,20 @@ nautilus_window_slot_dispose (GObject *o
|
||||
|
||||
slot = NAUTILUS_WINDOW_SLOT (object);
|
||||
|
||||
+ if (slot->content_view) {
|
||||
+ widget = nautilus_view_get_widget (slot->content_view);
|
||||
+ gtk_widget_destroy (widget);
|
||||
+ g_object_unref (slot->content_view);
|
||||
+ slot->content_view = NULL;
|
||||
+ }
|
||||
+
|
||||
+ if (slot->new_content_view) {
|
||||
+ widget = nautilus_view_get_widget (slot->new_content_view);
|
||||
+ gtk_widget_destroy (widget);
|
||||
+ g_object_unref (slot->new_content_view);
|
||||
+ slot->new_content_view = NULL;
|
||||
+ }
|
||||
+
|
||||
nautilus_window_slot_set_viewed_file (slot, NULL);
|
||||
/* TODO? why do we unref here? the file is NULL.
|
||||
* It was already here before the slot move, though */
|
||||
@@ -598,20 +612,6 @@ nautilus_window_slot_dispose (GObject *o
|
||||
slot->find_mount_cancellable = NULL;
|
||||
}
|
||||
|
||||
- if (slot->content_view) {
|
||||
- widget = nautilus_view_get_widget (slot->content_view);
|
||||
- gtk_widget_destroy (widget);
|
||||
- g_object_unref (slot->content_view);
|
||||
- slot->content_view = NULL;
|
||||
- }
|
||||
-
|
||||
- if (slot->new_content_view) {
|
||||
- widget = nautilus_view_get_widget (slot->new_content_view);
|
||||
- gtk_widget_destroy (widget);
|
||||
- g_object_unref (slot->new_content_view);
|
||||
- slot->new_content_view = NULL;
|
||||
- }
|
||||
-
|
||||
slot->window = NULL;
|
||||
|
||||
g_free (slot->title);
|
@ -16,7 +16,7 @@
|
||||
Name: nautilus
|
||||
Summary: File manager for GNOME
|
||||
Version: 2.25.2
|
||||
Release: 5%{?dist}
|
||||
Release: 6%{?dist}
|
||||
License: GPLv2+
|
||||
Group: User Interface/Desktops
|
||||
Source: http://download.gnome.org/sources/%{name}/2.25/%{name}-%{version}.tar.bz2
|
||||
@ -91,6 +91,7 @@ Patch17: nautilus-filetype-symlink-fix.patch
|
||||
|
||||
# http://bugzilla.gnome.org/show_bug.cgi?id=552859
|
||||
Patch18: eel-2.24.0-fade.patch
|
||||
Patch19: nautilus-2.25.2-fix-crasher.patch
|
||||
|
||||
|
||||
%description
|
||||
@ -132,6 +133,7 @@ for developing nautilus extensions.
|
||||
%patch15 -p1 -b .xds
|
||||
%patch17 -p0 -b .symlink
|
||||
%patch18 -p1 -b .fade
|
||||
%patch19 -p1 -b .fix-crasher
|
||||
|
||||
%build
|
||||
|
||||
@ -263,6 +265,10 @@ fi
|
||||
|
||||
|
||||
%changelog
|
||||
* Wed Jan 7 2009 Ray Strode <rstrode@redhat.com> - 2.25.2-6
|
||||
- Don't crash when closing spatial window very quickly after
|
||||
opening it (gnome bug 552859)
|
||||
|
||||
* Thu Dec 18 2008 Matthias Clasen <mclasen@redhat.com> - 2.25.2-5
|
||||
- Fix spec
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user