Skip to content

Commit

Permalink
caja-desktop-window.c: Fix: caja crashes unexpectedly
Browse files Browse the repository at this point in the history
  • Loading branch information
sc0w authored and lukefromdc committed Jun 5, 2018
1 parent b0899ef commit 3720401
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/caja-desktop-window.c
Expand Up @@ -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.
Expand Down

0 comments on commit 3720401

Please sign in to comment.