diff options
author | Matthias Clasen <mclasen@redhat.com> | 2009-07-06 02:03:21 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2009-07-06 02:03:21 -0400 |
commit | dab552dc2249fc1b569ffaf93f039c9f3382f67e (patch) | |
tree | 712764ddc011c36833499d183fdbf9a19e3e0e37 /gtk/gtktrayicon-x11.c | |
parent | 42e7318b620ad73bd16b28b8f4d648350a337604 (diff) | |
download | gtk+-dab552dc2249fc1b569ffaf93f039c9f3382f67e.tar.gz |
Use gdk_display_sync instead of XSync
Diffstat (limited to 'gtk/gtktrayicon-x11.c')
-rw-r--r-- | gtk/gtktrayicon-x11.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/gtk/gtktrayicon-x11.c b/gtk/gtktrayicon-x11.c index 075ff69709..32c3140545 100644 --- a/gtk/gtktrayicon-x11.c +++ b/gtk/gtktrayicon-x11.c @@ -441,7 +441,7 @@ gtk_tray_icon_send_manager_message (GtkTrayIcon *icon, gdk_error_trap_push (); XSendEvent (display, icon->priv->manager_window, False, NoEventMask, (XEvent *)&ev); - XSync (display, False); + gdk_display_sync (gtk_widget_get_display (GTK_WIDGET (icon))); gdk_error_trap_pop (); } @@ -646,11 +646,12 @@ _gtk_tray_icon_send_message (GtkTrayIcon *icon, gint len) { guint stamp; - + Display *xdisplay; + g_return_val_if_fail (GTK_IS_TRAY_ICON (icon), 0); g_return_val_if_fail (timeout >= 0, 0); g_return_val_if_fail (message != NULL, 0); - + if (icon->priv->manager_window == None) return 0; @@ -665,14 +666,12 @@ _gtk_tray_icon_send_message (GtkTrayIcon *icon, timeout, len, stamp); /* Now to send the actual message */ + xdisplay = GDK_DISPLAY_XDISPLAY (gtk_widget_get_display (GTK_WIDGET (icon))); gdk_error_trap_push (); while (len > 0) { XClientMessageEvent ev; - Display *xdisplay; - xdisplay = GDK_DISPLAY_XDISPLAY (gtk_widget_get_display (GTK_WIDGET (icon))); - memset (&ev, 0, sizeof (ev)); ev.type = ClientMessage; ev.window = (Window)gtk_plug_get_id (GTK_PLUG (icon)); @@ -692,11 +691,10 @@ _gtk_tray_icon_send_message (GtkTrayIcon *icon, } XSendEvent (xdisplay, - icon->priv->manager_window, False, + icon->priv->manager_window, False, StructureNotifyMask, (XEvent *)&ev); - XSync (xdisplay, False); } - + gdk_display_sync (gtk_widget_get_display (GTK_WIDGET (icon))); gdk_error_trap_pop (); return stamp; |