diff --git a/moo.kdevelop b/moo.kdevelop index 9f4780a4..89f02634 100644 --- a/moo.kdevelop +++ b/moo.kdevelop @@ -292,16 +292,16 @@ - + A new empty GAP source file - + A new empty C++ file. - + A new empty header file for C/C++. - + A new empty C file. diff --git a/moo/mooutils/mooutils-misc.c b/moo/mooutils/mooutils-misc.c index 205be788..7533e8fa 100644 --- a/moo/mooutils/mooutils-misc.c +++ b/moo/mooutils/mooutils-misc.c @@ -1458,97 +1458,3 @@ moo_widget_set_tooltip (GtkWidget *widget, else gtk_tooltips_set_tip (tooltips, widget, tip, tip); } - - -/******************************************************************************/ -/* Startup notification - */ - -#ifdef GDK_WINDOWING_X11 - -void -moo_remove_startup_notify (GtkWidget *widget) -{ - const char *id; - char *message, *ptr; - guint message_len; - GdkWindow *window, *root; - GdkWindow *freeme = NULL; - GdkAtom type_atom_begin, type_atom; - - id = g_getenv ("DESKTOP_STARTUP_ID"); - - if (!id) - { -// g_message ("no DESKTOP_STARTUP_ID variable"); - return; - } - - message = g_strdup_printf ("remove: ID=%s", id); - message_len = strlen (message) + 1; - g_unsetenv ("DESKTOP_STARTUP_ID"); - - if (widget && widget->window) - { - GdkScreen *screen = gtk_widget_get_screen (widget); - g_return_if_fail (screen != NULL); - window = widget->window; - root = gdk_screen_get_root_window (screen); - g_return_if_fail (root != NULL); - } - else - { - static GdkWindowAttr attributes; - GdkScreen *screen; - - screen = gdk_screen_get_default (); - g_return_if_fail (screen != NULL); - root = gdk_screen_get_root_window (screen); - g_return_if_fail (root != NULL); - - attributes.window_type = GDK_WINDOW_TEMP; - freeme = window = gdk_window_new (root, &attributes, 0); - g_return_if_fail (window != NULL); - } - - ptr = message; - type_atom_begin = gdk_atom_intern ("_NET_STARTUP_INFO_BEGIN", FALSE); - type_atom = gdk_atom_intern ("_NET_STARTUP_INFO", FALSE); - - while (message_len) - { - GdkEvent *event; - guint len; - - event = gdk_event_new (GDK_CLIENT_EVENT); - event->client.send_event = TRUE; - event->client.window = g_object_ref (window); - event->client.data_format = 8; - event->client.message_type = ptr == message ? type_atom_begin : type_atom; - - len = MIN (message_len, 20); - memcpy (event->client.data.b, ptr, len); - ptr += len; - message_len -= len; - - gdk_event_send_client_message (event, GDK_WINDOW_XID (root)); - - gdk_event_free (event); - } - - if (freeme) - { - gdk_window_destroy (freeme); - g_object_unref (freeme); - } - - gdk_flush (); - g_free (message); -} - -#else /* !GDK_WINDOWING_X11 */ -void -moo_remove_startup_notify (G_GNUC_UNUSED GtkWidget *widget) -{ -} -#endif diff --git a/moo/mooutils/mooutils-misc.h b/moo/mooutils/mooutils-misc.h index e2f5d123..70afc784 100644 --- a/moo/mooutils/mooutils-misc.h +++ b/moo/mooutils/mooutils-misc.h @@ -99,8 +99,6 @@ void moo_menu_item_set_label (GtkWidget *menu_item, void moo_widget_set_tooltip (GtkWidget *widget, const char *tip); -void moo_remove_startup_notify (GtkWidget *widget); - G_END_DECLS diff --git a/tests/medit-app.c b/tests/medit-app.c index e01d356f..1a304a28 100644 --- a/tests/medit-app.c +++ b/tests/medit-app.c @@ -284,13 +284,13 @@ int main (int argc, char *argv[]) if (!moo_app_init (app)) { - moo_remove_startup_notify (NULL); + gdk_notify_startup_complete (); return 0; } editor = moo_app_get_editor (app); window = moo_editor_new_window (editor); - moo_remove_startup_notify (window); + gdk_notify_startup_complete (); g_signal_connect_swapped (editor, "all-windows-closed", G_CALLBACK (moo_app_quit), app); diff --git a/tests/medit-app.opag b/tests/medit-app.opag index a202c30c..1332b8b2 100644 --- a/tests/medit-app.opag +++ b/tests/medit-app.opag @@ -116,19 +116,20 @@ int main (int argc, char *argv[]) if (!moo_app_init (app)) { - moo_remove_startup_notify (NULL); + gdk_notify_startup_complete (); return 0; } editor = moo_app_get_editor (app); window = moo_editor_new_window (editor); - moo_remove_startup_notify (window); + gdk_notify_startup_complete (); g_signal_connect_swapped (editor, "all-windows-closed", G_CALLBACK (moo_app_quit), app); retval = moo_app_run (app); + g_free (startup_id); g_object_unref (app); return retval; }