diff options
author | rsc <devnull@localhost> | 2005-01-07 18:44:21 +0000 |
---|---|---|
committer | rsc <devnull@localhost> | 2005-01-07 18:44:21 +0000 |
commit | 60efa1d2b90cbcfedcd93a988834fc595a5368bb (patch) | |
tree | 80f67268e255a466d3e61c6c32275ebe25829847 /src/libdraw | |
parent | 7d0dbb314f77b79bb729162a59a6ea3d93807eb9 (diff) | |
download | plan9port-60efa1d2b90cbcfedcd93a988834fc595a5368bb.tar.gz plan9port-60efa1d2b90cbcfedcd93a988834fc595a5368bb.tar.bz2 plan9port-60efa1d2b90cbcfedcd93a988834fc595a5368bb.zip |
seems to correct lack of focus when
coming back from being hidden.
not strictly correct in multithreaded
programs but let's see if anything breaks.
Diffstat (limited to 'src/libdraw')
-rw-r--r-- | src/libdraw/x11-wsys.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/libdraw/x11-wsys.c b/src/libdraw/x11-wsys.c index 83f3e1b4..48c12829 100644 --- a/src/libdraw/x11-wsys.c +++ b/src/libdraw/x11-wsys.c @@ -10,9 +10,17 @@ drawtopwindow(void) { XMapRaised(_x.display, _x.drawable); XFlush(_x.display); - XSetInputFocus(_x.display, _x.drawable, RevertToPointerRoot, + /* + * Should not be using kbdcon since we're not running + * in the kbdproc, but this is necessary to make the keyboard + * take focus if the window is hidden when drawtopwindow + * is called. Let's hope that XSetInputFocus is only a write + * on the fd, and so it's okay to do even though the kbdproc + * is reading at the same time. + */ + XSetInputFocus(_x.kbdcon, _x.drawable, RevertToPointerRoot, CurrentTime); - XFlush(_x.display); + XFlush(_x.kbdcon); } void |