diff options
author | Jasmine Hassan <[email protected]> | 2012-11-25 07:52:05 +0200 |
---|---|---|
committer | Jasmine Hassan <[email protected]> | 2012-12-03 21:15:16 +0200 |
commit | 83a8343b64850c98e5e650ee464e12d71fb595b8 (patch) | |
tree | b2dcc44948a0c4df374af29f06e0cdc385fcfb8b | |
parent | 12908bcb598233adabd7492d92efdda3d2cbc47c (diff) | |
download | caja-83a8343b64850c98e5e650ee464e12d71fb595b8.tar.bz2 caja-83a8343b64850c98e5e650ee464e12d71fb595b8.tar.xz |
[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).
-rw-r--r-- | eel/eel-background.c | 27 |
1 files changed, 26 insertions, 1 deletions
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 |