Skip to content

Commit 3720401

Browse files
sc0wlukefromdc
authored andcommitted
caja-desktop-window.c: Fix: caja crashes unexpectedly
Fixes #1005 (comment)
1 parent b0899ef commit 3720401

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/caja-desktop-window.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,19 @@ caja_desktop_window_new (CajaApplication *application,
152152
/* will cause the desktop window to open at the wrong size in gtk 3.20 */
153153
gtk_window_set_default_size (GTK_WINDOW (window), -1, -1);
154154

155+
/* Special sawmill setting*/
156+
GdkWindow *gdkwin;
157+
gtk_widget_realize (GTK_WIDGET (window));
158+
gdkwin = gtk_widget_get_window (GTK_WIDGET (window));
159+
if (gdk_window_ensure_native (gdkwin)) {
160+
Display *disp = GDK_DISPLAY_XDISPLAY (gdk_window_get_display (gdkwin));
161+
XClassHint *xch = XAllocClassHint ();
162+
xch->res_name = "desktop_window";
163+
xch->res_class = "Caja";
164+
XSetClassHint (disp, GDK_WINDOW_XID(gdkwin), xch);
165+
XFree(xch);
166+
}
167+
155168
g_signal_connect (window, "delete_event", G_CALLBACK (caja_desktop_window_delete_event), NULL);
156169

157170
/* Point window at the desktop folder.

0 commit comments

Comments
 (0)