gtk_widget_shape_combine_mask(iconwin, mask, 0, 0);
}
+static GtkWidget *
+dockapp_win_init(GtkWindowType window_type)
+{
+ GtkWidget *win;
+
+ win = gtk_window_new(window_type);
+ gtk_window_set_wmclass(GTK_WINDOW(win), g_get_prgname(), "DockApp");
+ gtk_widget_set_size_request(win, ICON_SIZE, ICON_SIZE);
+ gtk_widget_set_app_paintable(win, true);
+ gtk_widget_realize(win);
+
+ return win;
+}
+
/*******************************************************************************
* New window creation and initialization for a Dockable Application
******************************************************************************/
gtk_init(&argc, &argv);
- dockwin = gtk_window_new(GTK_WINDOW_TOPLEVEL);
- iconwin = gtk_window_new(GTK_WINDOW_POPUP);
-
- gtk_window_set_wmclass(GTK_WINDOW(dockwin), g_get_prgname(), "DockApp");
- gtk_window_set_wmclass(GTK_WINDOW(iconwin), g_get_prgname(), "DockApp");
-
- gtk_widget_set_size_request(dockwin, ICON_SIZE, ICON_SIZE);
- gtk_widget_set_size_request(iconwin, ICON_SIZE, ICON_SIZE);
- gtk_widget_set_app_paintable(dockwin, TRUE);
- gtk_widget_set_app_paintable(iconwin, TRUE);
+ dockwin = dockapp_win_init(GTK_WINDOW_TOPLEVEL);
+ iconwin = dockapp_win_init(GTK_WINDOW_POPUP);
gtk_window_set_default_size(GTK_WINDOW(dockwin), ICON_SIZE, ICON_SIZE);
-
g_signal_connect(dockwin, "destroy", G_CALLBACK(gtk_main_quit), NULL);
- gtk_widget_realize(dockwin);
- gtk_widget_realize(iconwin);
-
/* Sets the icon of dockwin as iconwin. */
gdk_window_set_icon(dockwin->window, iconwin->window, NULL, NULL);
hvclock_init(iconwin);
-
gtk_widget_show(iconwin);
#ifdef GTK_WITHDRAWN_HACK