summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorColin Walters <walters@space-ghost.verbum.private>2008-03-31 18:16:00 -0400
committerColin Walters <walters@space-ghost.verbum.private>2008-03-31 18:16:00 -0400
commit193ebb7083fb1e9dccff04fc0a9d805a0aa03ea2 (patch)
tree980ab3d192f4b76945ba103bf3037a07c6dd7f9d /tools
parent4058579dae09659ea2dc7f3dd20e034a3be3b0bf (diff)
Make sure we call XFlush() on all code paths (FDO bug #15293)
Diffstat (limited to 'tools')
-rw-r--r--tools/dbus-launch-x11.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/tools/dbus-launch-x11.c b/tools/dbus-launch-x11.c
index 927d8634..442e9ba2 100644
--- a/tools/dbus-launch-x11.c
+++ b/tools/dbus-launch-x11.c
@@ -341,7 +341,7 @@ static Window
set_address_in_x11(char *address, pid_t pid)
{
char *current_address;
- Window wid;
+ Window wid = None;
unsigned long pid32; /* Xlib property functions want _long_ not 32-bit for format "32" */
/* lock the X11 display to make sure we're doing this atomically */
@@ -350,16 +350,14 @@ set_address_in_x11(char *address, pid_t pid)
if (!x11_get_address (&current_address, NULL, NULL))
{
/* error! */
- XUngrabServer (xdisplay);
- return None;
+ goto out;
}
if (current_address != NULL)
{
/* someone saved the address in the meantime */
- XUngrabServer (xdisplay);
free (current_address);
- return None;
+ goto out;
}
/* Create our window */
@@ -378,9 +376,11 @@ set_address_in_x11(char *address, pid_t pid)
/* Now grab the selection */
XSetSelectionOwner (xdisplay, selection_atom, wid, CurrentTime);
+ out:
/* Ungrab the server to let other people use it too */
XUngrabServer (xdisplay);
+ /* And make sure that the ungrab gets sent to X11 */
XFlush (xdisplay);
return wid;