/* Specifies the border width */
#define BWIDTH 2
+static void
+dockapp_set_withdrawn_state(Display *d, Window w)
+{
+ XWMHints *hints;
+
+ hints = XGetWMHints(d, w);
+ hints->flags |= StateHint;
+ hints->initial_state = WithdrawnState;
+ XSetWMHints(d, w, hints);
+ XFree(hints);
+}
+
/*******************************************************************************
* New window creation and initialization for a Dockable Application
******************************************************************************/
{
GtkWidget *dockwin;
GtkWidget *iconwin;
- XWMHints wm_hints;
gtk_init(&argc, &argv);
gtk_widget_show_all(dockwin);
if (hvclock_infos.dockapp_mode == true) {
- /* Dockapp specific initialization */
- wm_hints.flags = StateHint | IconWindowHint | WindowGroupHint;
- wm_hints.initial_state = WithdrawnState;
- wm_hints.icon_window = GDK_WINDOW_XWINDOW(iconwin->window);
- wm_hints.window_group = GDK_WINDOW_XWINDOW(dockwin->window);
-
- XSetWMHints(GDK_DISPLAY_XDISPLAY(gdk_display_get_default()),
- GDK_WINDOW_XWINDOW(dockwin->window), &wm_hints);
+ dockapp_set_withdrawn_state(
+ GDK_DISPLAY_XDISPLAY(gdk_display_get_default()),
+ GDK_WINDOW_XWINDOW(dockwin->window));
}
}