Use gdk_display_sync instead of XSync

This commit is contained in:
Matthias Clasen 2009-07-06 02:03:21 -04:00
parent 42e7318b62
commit dab552dc22

View File

@ -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,6 +646,7 @@ _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);
@ -665,13 +666,11 @@ _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;
@ -694,9 +693,8 @@ _gtk_tray_icon_send_message (GtkTrayIcon *icon,
XSendEvent (xdisplay,
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;