From cac8fbb15e281f557a5ac46700bc04f74c77df3c Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Dec 10 2009 23:24:36 +0000 Subject: update the background patch --- diff --git a/nautilus-monitor-change.patch b/nautilus-monitor-change.patch index e0025ac..6c10754 100644 --- a/nautilus-monitor-change.patch +++ b/nautilus-monitor-change.patch @@ -1,8 +1,37 @@ +From cd770f34590de85b7ea0f0feccf5657590550918 Mon Sep 17 00:00:00 2001 +From: William Jon McCann +Date: Thu, 3 Dec 2009 23:52:08 -0500 +Subject: [PATCH] Fixes to enable per-monitor backgrounds + +https://bugzilla.gnome.org/show_bug.cgi?id=147808 +--- + eel/eel-background.c | 81 +++++++++++++++++++++---------------------------- + 1 files changed, 35 insertions(+), 46 deletions(-) + diff --git a/eel/eel-background.c b/eel/eel-background.c -index 9c40629..2854a07 100644 +index 9c40629..4d9e8e8 100644 --- a/eel/eel-background.c +++ b/eel/eel-background.c -@@ -94,6 +94,8 @@ struct EelBackgroundDetails { +@@ -50,8 +50,8 @@ static void eel_background_init (gpointer objec + static void eel_background_finalize (GObject *object); + static GdkPixmap *eel_background_get_pixmap_and_color (EelBackground *background, + GdkWindow *window, +- GdkColor *color, +- gboolean *changes_with_size); ++ GdkColor *color); ++ + static void set_image_properties (EelBackground *background); + + static void init_fade (EelBackground *background, GtkWidget *widget); +@@ -80,7 +80,6 @@ struct EelBackgroundDetails { + GtkWidget *widget; + + /* Realized data: */ +- gboolean background_changes_with_size; + GdkPixmap *background_pixmap; + gboolean background_pixmap_is_unset_root_pixmap; + GnomeBGCrossfade *fade; +@@ -94,6 +93,8 @@ struct EelBackgroundDetails { gboolean is_desktop; /* Desktop screen size watcher */ gulong screen_size_handler; @@ -11,7 +40,134 @@ index 9c40629..2854a07 100644 /* Can we use common pixmap for root window and desktop window */ gboolean use_common_pixmap; guint change_idle_id; -@@ -869,7 +871,6 @@ screen_size_changed (GdkScreen *screen, EelBackground *background) +@@ -365,14 +366,6 @@ eel_background_ensure_realized (EelBackground *background, GdkWindow *window) + gdk_rgb_find_color (style->colormap, &(background->details->default_color)); + } + +- /* If the pixmap doesn't change with the window size, never update +- * it again. +- */ +- if (background->details->background_pixmap != NULL && +- !background->details->background_changes_with_size) { +- return FALSE; +- } +- + /* If the window size is the same as last time, don't update */ + if (entire_width == background->details->background_entire_width && + entire_height == background->details->background_entire_height) { +@@ -385,7 +378,6 @@ eel_background_ensure_realized (EelBackground *background, GdkWindow *window) + + set_image_properties (background); + +- background->details->background_changes_with_size = gnome_bg_changes_with_size (background->details->bg); + background->details->background_pixmap = gnome_bg_create_pixmap (background->details->bg, + window, + entire_width, entire_height, +@@ -408,8 +400,7 @@ eel_background_ensure_realized (EelBackground *background, GdkWindow *window) + static GdkPixmap * + eel_background_get_pixmap_and_color (EelBackground *background, + GdkWindow *window, +- GdkColor *color, +- gboolean *changes_with_size) ++ GdkColor *color) + { + int entire_width; + int entire_height; +@@ -419,7 +410,6 @@ eel_background_get_pixmap_and_color (EelBackground *background, + eel_background_ensure_realized (background, window); + + *color = background->details->default_color; +- *changes_with_size = background->details->background_changes_with_size; + + if (background->details->background_pixmap != NULL) { + return g_object_ref (background->details->background_pixmap); +@@ -434,7 +424,6 @@ eel_background_expose (GtkWidget *widget, + GdkColor color; + int window_width; + int window_height; +- gboolean changes_with_size; + GdkPixmap *pixmap; + GdkGC *gc; + GdkGCValues gc_values; +@@ -452,19 +441,8 @@ eel_background_expose (GtkWidget *widget, + + pixmap = eel_background_get_pixmap_and_color (background, + widget->window, +- &color, +- &changes_with_size); +- +- if (!changes_with_size) { +- /* The background was already drawn by X, since we set +- * the GdkWindow background/back_pixmap. +- * No need to draw it again. */ +- if (pixmap) { +- g_object_unref (pixmap); +- } +- return; +- } +- ++ &color); ++ + if (pixmap) { + gc_values.tile = pixmap; + gc_values.ts_x_origin = 0; +@@ -670,12 +648,10 @@ set_root_pixmap (EelBackground *background, + GdkPixmap *pixmap, *root_pixmap; + GdkScreen *screen; + GdkColor color; +- gboolean changes_with_size; + + pixmap = eel_background_get_pixmap_and_color (background, + window, +- &color, +- &changes_with_size); ++ &color); + screen = gdk_drawable_get_screen (window); + + if (background->details->use_common_pixmap) { +@@ -730,7 +706,6 @@ eel_background_set_up_widget (EelBackground *background, GtkWidget *widget) + int window_height; + + GdkWindow *window; +- gboolean changes_with_size; + gboolean in_fade; + + if (!GTK_WIDGET_REALIZED (widget)) { +@@ -741,8 +716,7 @@ eel_background_set_up_widget (EelBackground *background, GtkWidget *widget) + + pixmap = eel_background_get_pixmap_and_color (background, + widget->window, +- &color, +- &changes_with_size); ++ &color); + + style = gtk_widget_get_style (widget); + +@@ -761,17 +735,14 @@ eel_background_set_up_widget (EelBackground *background, GtkWidget *widget) + } + + if (!in_fade) { +- if (!changes_with_size || background->details->is_desktop) { +- gdk_window_set_back_pixmap (window, pixmap, FALSE); +- } else { +- gdk_window_set_back_pixmap (window, NULL, FALSE); +- gdk_window_set_background (window, &color); +- } ++ if (background->details->is_desktop) { ++ gdk_window_set_back_pixmap (window, pixmap, FALSE); ++ } else { ++ gdk_window_set_back_pixmap (window, NULL, FALSE); ++ gdk_window_set_background (window, &color); ++ } + } + +- background->details->background_changes_with_size = +- gnome_bg_changes_with_size (background->details->bg); +- + if (background->details->is_desktop && !in_fade) { + set_root_pixmap (background, window); + } +@@ -869,7 +840,6 @@ screen_size_changed (GdkScreen *screen, EelBackground *background) g_signal_emit (background, signals[APPEARANCE_CHANGED], 0); } @@ -19,7 +175,7 @@ index 9c40629..2854a07 100644 static void widget_realized_setup (GtkWidget *widget, gpointer data) { -@@ -891,6 +892,13 @@ widget_realized_setup (GtkWidget *widget, gpointer data) +@@ -891,6 +861,13 @@ widget_realized_setup (GtkWidget *widget, gpointer data) background->details->screen_size_handler = g_signal_connect (screen, "size_changed", G_CALLBACK (screen_size_changed), background); @@ -33,7 +189,7 @@ index 9c40629..2854a07 100644 root_window = gdk_screen_get_root_window(screen); -@@ -928,6 +936,11 @@ widget_unrealize_cb (GtkWidget *widget, gpointer data) +@@ -928,6 +905,11 @@ widget_unrealize_cb (GtkWidget *widget, gpointer data) background->details->screen_size_handler); background->details->screen_size_handler = 0; } @@ -45,3 +201,22 @@ index 9c40629..2854a07 100644 background->details->use_common_pixmap = FALSE; } +@@ -1022,7 +1004,14 @@ eel_get_widget_background (GtkWidget *widget) + gboolean + eel_background_is_dark (EelBackground *background) + { +- return gnome_bg_is_dark (background->details->bg); ++ GdkScreen *screen; ++ GdkRectangle rect; ++ ++ /* only check for the background on the 0th monitor */ ++ screen = gdk_screen_get_default (); ++ gdk_screen_get_monitor_geometry (screen, 0, &rect); ++ ++ return gnome_bg_is_dark (background->details->bg, rect.width, rect.height); + } + + /* handle dropped colors */ +-- +1.6.5.2 + diff --git a/nautilus.spec b/nautilus.spec index 36f70d9..fbbfe75 100644 --- a/nautilus.spec +++ b/nautilus.spec @@ -4,7 +4,7 @@ %define gnome_icon_theme_version 1.1.5 %define libxml2_version 2.4.20 %define desktop_file_utils_version 0.7 -%define gnome_desktop_version 2.25.5 +%define gnome_desktop_version 2.28.1-6 %define redhat_menus_version 0.25 %define startup_notification_version 0.5 %define libexif_version 0.5.12 @@ -15,7 +15,7 @@ Name: nautilus Summary: File manager for GNOME Version: 2.28.2 -Release: 2%{?dist} +Release: 3%{?dist} License: GPLv2+ Group: User Interface/Desktops Source: http://download.gnome.org/sources/%{name}/2.28/%{name}-%{version}.tar.bz2 @@ -59,6 +59,7 @@ BuildRequires: gtk-doc Requires(pre): GConf2 >= %{gconf_version} Requires(preun): GConf2 >= %{gconf_version} Requires(post): GConf2 >= %{gconf_version} +Requires: gnome-desktop >= %{gnome_desktop_version} Obsoletes: nautilus-extras Obsoletes: nautilus-suggested @@ -269,6 +270,9 @@ fi %changelog +* Thu Dec 10 2009 Jon McCann - 2.28.2-3 +- Update the monitor changes patch (gnome #147808) + * Tue Dec 8 2009 Tomas Bzatek - 2.28.2-2 - Fix some memory leaks