diff options
author | Pablo Barciela <[email protected]> | 2018-06-05 22:43:52 +0200 |
---|---|---|
committer | lukefromdc <[email protected]> | 2018-06-05 18:01:27 -0400 |
commit | 3720401f7a091462988268c849e3750ee48fff88 (patch) | |
tree | c3f7eac0ed0a0f9c29e8de8997b6ebd6422ca726 /src/caja-desktop-window.c | |
parent | b0899efae287fd7b04024dc5465163c54aa16db0 (diff) | |
download | caja-3720401f7a091462988268c849e3750ee48fff88.tar.bz2 caja-3720401f7a091462988268c849e3750ee48fff88.tar.xz |
caja-desktop-window.c: Fix: caja crashes unexpectedly
Fixes https://github.com/mate-desktop/caja/pull/1005#issuecomment-394805519
Diffstat (limited to 'src/caja-desktop-window.c')
-rw-r--r-- | src/caja-desktop-window.c | 13 |
1 files changed, 13 insertions, 0 deletions
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. |