From 3720401f7a091462988268c849e3750ee48fff88 Mon Sep 17 00:00:00 2001 From: Pablo Barciela Date: Tue, 5 Jun 2018 22:43:52 +0200 Subject: caja-desktop-window.c: Fix: caja crashes unexpectedly Fixes https://github.com/mate-desktop/caja/pull/1005#issuecomment-394805519 --- src/caja-desktop-window.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/caja-desktop-window.c b/src/caja-desktop-window.c index edba0e33..7bbd08cb 100644 --- a/src/caja-desktop-window.c +++ b/src/caja-desktop-window.c @@ -152,6 +152,19 @@ caja_desktop_window_new (CajaApplication *application, /* will cause the desktop window to open at the wrong size in gtk 3.20 */ gtk_window_set_default_size (GTK_WINDOW (window), -1, -1); + /* Special sawmill setting*/ + GdkWindow *gdkwin; + gtk_widget_realize (GTK_WIDGET (window)); + gdkwin = gtk_widget_get_window (GTK_WIDGET (window)); + if (gdk_window_ensure_native (gdkwin)) { + Display *disp = GDK_DISPLAY_XDISPLAY (gdk_window_get_display (gdkwin)); + XClassHint *xch = XAllocClassHint (); + xch->res_name = "desktop_window"; + xch->res_class = "Caja"; + XSetClassHint (disp, GDK_WINDOW_XID(gdkwin), xch); + XFree(xch); + } + g_signal_connect (window, "delete_event", G_CALLBACK (caja_desktop_window_delete_event), NULL); /* Point window at the desktop folder. -- cgit v1.2.1