Removed moo_remove_startup_notify(), it's in gdk!
This commit is contained in:
parent
79c1f4f2e0
commit
7aa195f0b3
@ -292,16 +292,16 @@
|
||||
</kdevdoctreeview>
|
||||
<kdevfilecreate>
|
||||
<filetypes>
|
||||
<type icon="source" ext="g" create="template" name="GAP source" >
|
||||
<type icon="source" ext="g" name="GAP source" create="template" >
|
||||
<descr>A new empty GAP source file</descr>
|
||||
</type>
|
||||
<type icon="source_cpp" ext="cpp" create="template" name="C++ Source" >
|
||||
<type icon="source_cpp" ext="cpp" name="C++ Source" create="template" >
|
||||
<descr>A new empty C++ file.</descr>
|
||||
</type>
|
||||
<type icon="source_h" ext="h" create="template" name="C/C++ Header" >
|
||||
<type icon="source_h" ext="h" name="C/C++ Header" create="template" >
|
||||
<descr>A new empty header file for C/C++.</descr>
|
||||
</type>
|
||||
<type icon="source_c" ext="c" create="template" name="C Source" >
|
||||
<type icon="source_c" ext="c" name="C Source" create="template" >
|
||||
<descr>A new empty C file.</descr>
|
||||
</type>
|
||||
</filetypes>
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user