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.
This commit is contained in:
rsc 2005-01-07 18:44:21 +00:00
parent 7d0dbb314f
commit 60efa1d2b9

View file

@ -10,9 +10,17 @@ drawtopwindow(void)
{ {
XMapRaised(_x.display, _x.drawable); XMapRaised(_x.display, _x.drawable);
XFlush(_x.display); 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); CurrentTime);
XFlush(_x.display); XFlush(_x.kbdcon);
} }
void void