[gtk+] Use gdk_display_sync instead of XSync
- From: Matthias Clasen <matthiasc src gnome org>
- To: svn-commits-list gnome org
- Subject: [gtk+] Use gdk_display_sync instead of XSync
- Date: Mon, 6 Jul 2009 06:03:45 +0000 (UTC)
commit dab552dc2249fc1b569ffaf93f039c9f3382f67e
Author: Matthias Clasen <mclasen redhat com>
Date: Mon Jul 6 02:03:21 2009 -0400
Use gdk_display_sync instead of XSync
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 075ff69..32c3140 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;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]