Commit 656a261f authored by djkurtz@chromium.org's avatar djkurtz@chromium.org

Flush Xlib output buffer after calling XUngrabServer

One of the horrors of using Xlib is its Output buffer.  When calling Xlib
functions, the X command bitstream is not actually sent right away.
Commands are first queued up in the Xlib output buffer, and only sent over
the wire when the output buffer is flushed.

X clients typically don't have to worry about this, since (a) commands
that require return a response are flushed immediately, and
(b) they usually have an event loop that calls XPending() (XNextEvent(),
or XWindowEvent()), which does a Flush internally.

Chrome, however, listens to the Xserver fd, and only enters its XPending()
loop if the File Can be Read Without Blocking.

The quick and dirty fix is to just send an explicit XFlush() after
XUngrabServer().
Signed-off-by: default avatarDaniel Kurtz <djkurtz@chromium.org>

BUG=chromium:366125
TEST=tbd

R=msw@chromium.org
R=erg@chromium.org

Review URL: https://codereview.chromium.org/246723006

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@266455 0039d316-1c4b-4281-b951-d872f2087c98
parent 06272e2f
......@@ -310,6 +310,7 @@ bool X11WholeScreenMoveLoop::GrabPointerAndKeyboard(gfx::NativeCursor cursor) {
}
XUngrabServer(display);
XFlush(display);
return ret == GrabSuccess;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment