diff options
author | lukefromdc <[email protected]> | 2016-08-10 13:41:53 -0400 |
---|---|---|
committer | raveit65 <[email protected]> | 2016-08-10 19:54:37 +0200 |
commit | f5164f75918a8e65ccde9565c4fd9f366064172e (patch) | |
tree | 5e20d93a4acbefd30e03042d5c36596f2568b008 /src | |
parent | e5cb35ed5701a28b7a91cf2919f8695f9c8776af (diff) | |
download | caja-f5164f75918a8e65ccde9565c4fd9f366064172e.tar.bz2 caja-f5164f75918a8e65ccde9565c4fd9f366064172e.tar.xz |
Fix background change crash
Apply https://gist.github.com/raveit65/51b40a20f8836562369fc155a828edc4 to add a "finalize" function to the desktop window and stop background-change crashes after turning icons off-or off and back on.
Also match tab styling to that in rest of file, the one difference here from the patchfile.
Diffstat (limited to 'src')
-rw-r--r-- | src/caja-desktop-window.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/caja-desktop-window.c b/src/caja-desktop-window.c index 42f4214e..1cc14348 100644 --- a/src/caja-desktop-window.c +++ b/src/caja-desktop-window.c @@ -136,6 +136,25 @@ caja_desktop_window_draw (GtkWidget *widget, return GTK_WIDGET_CLASS (caja_desktop_window_parent_class)->draw (widget, cr); } +static void +caja_desktop_window_finalize (GObject *obj) +{ + CajaDesktopWindow *window = CAJA_DESKTOP_WINDOW (obj); + + if (window->details->composited == FALSE) { + GdkScreen *screen = gdk_screen_get_default (); + GdkWindow *root = gdk_screen_get_root_window (screen); + + gdk_window_remove_filter (root, (GdkFilterFunc) filter_func, window); + } + + if (window->details->surface) { + cairo_surface_destroy (window->details->surface); + window->details->surface = NULL; + } + + G_OBJECT_CLASS (caja_desktop_window_parent_class)->finalize (obj); +} #endif static void @@ -386,6 +405,11 @@ caja_desktop_window_class_init (CajaDesktopWindowClass *klass) { GtkWidgetClass *wclass = GTK_WIDGET_CLASS (klass); CajaWindowClass *nclass = CAJA_WINDOW_CLASS (klass); +#if GTK_CHECK_VERSION(3, 21, 0) + GObjectClass *object_class = G_OBJECT_CLASS (klass); + + object_class->finalize = caja_desktop_window_finalize; +#endif wclass->realize = realize; wclass->unrealize = unrealize; |