From 83a8343b64850c98e5e650ee464e12d71fb595b8 Mon Sep 17 00:00:00 2001 From: Jasmine Hassan Date: Sun, 25 Nov 2012 07:52:05 +0200 Subject: [eel-background] make sure screen size actually changed before emmitting signal that is, APPEARANCE_CHANGED signal. Also, add a verbose message to know when the signal is about to be emitted, hopefully to aid id debugging a 'BadPixmap (invalid Pixmap parameter)' error & crash when resizing VM window in VirtualBox (4.2.4-81684 as of date). --- eel/eel-background.c | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) (limited to 'eel') diff --git a/eel/eel-background.c b/eel/eel-background.c index ecfe3042..fefc55cc 100644 --- a/eel/eel-background.c +++ b/eel/eel-background.c @@ -903,10 +903,35 @@ widget_style_set_cb (GtkWidget *widget, GtkStyle *previous_style, gpointer data) } } +#define VERBOSE + static void screen_size_changed (GdkScreen *screen, EelBackground *background) { - g_signal_emit (background, signals[APPEARANCE_CHANGED], 0); + GdkWindow *window; + int w, h; + + window = gdk_screen_get_root_window(screen); + + /* Find the monitor where our desktop window is, then get its geometry */ +// GdkRectangle rect; +// gint monitor; +// monitor = gdk_screen_get_monitor_at_window (screen, window); +// gdk_screen_get_monitor_geometry (screen, monitor, &rect); +// g_message ("Resized GdkWindow = %dx%d\n", rect.width, rect.height); + + drawable_get_adjusted_size (background, window, &w, &h); + if (w != background->details->background_entire_width || + h != background->details->background_entire_height) + { +#ifdef VERBOSE + g_message ("size changed: %dx%d -> %dx%d. Emitting changed signal.\n", + background->details->background_entire_width, + background->details->background_entire_height, + w, h); +#endif + g_signal_emit (background, signals[APPEARANCE_CHANGED], 0); + } } static void -- cgit v1.2.1