[3ddesktop-dev] Losing keyboard focus problem
- From: Jeff Buck <jeffb@xxxxxxxx>
- To: 3ddesktop-dev@xxxxxxxxxxxxx
- Date: 23 May 2002 15:57:13 -0700
OK, I think I've found a way to make it easier for others to
duplicate the lost keyboard focus problem.. I think it does have
something to do with the speed of the computer/video/imlib or something.
On my box at work (which never had troubles before) I started having the
same issues with it after I had fried all my configs in a software
update. What I figure out though, was that if I turned up texturesize
setting, then the problem went away.
At texturesize=512, I have yet to see the problem.
At texturesize=256, I see the problem intermittently.
At texturesize=128, I see the problem very frequently.
I'm thinking that turning down the texture size simulates a faster
machine/video for the purposes of duplicating the problem. It hopefully
also gives a good clue as to exactly when focus gets lost as well.
I've still never managed to get into the code to try and figure anything
out, but with my skill level in C, that's probably for the better.
And it does seem to be related to how quickly you're baning away at the
keyboard also.
...time passes...
Finally.. with more testing, I can duplacate it (almost) every time.
I use CTRL-TAB to run 3ddesk. If my texturesize is set to 128, and
I hold down CTRL, then tap TAB, but don't release CTRL immediately, then
I've almost always lost keyboard focus. Maybe the grab fails because
there's already a key down? Why the delay for a larger texturesize would
prevent that from being a problem I'm not sure (keyrepeat??), but when
I have texturesize set to 512, then it doesn't seem to matter how long
I hold down CTRL, it works correctly every time anyway. When it's set
to texturesize=128, I can still almost always avoid the problem by
releasing CTRL and TAB very quickly.
Very strange. I hope these clues help.
...time passes...
OK, Looking at the code a bit, and the man pages a touch, I'll venture
a clueless guess or two. Unfortunately, I've spent more time than I
actually have playing with this, and I don't have the proper headers on
my box right now to actually try a compile.
Guess #1. Maybe doing something like "if (XGrabKeyboard(..))" or
while (!(XGrabKeyboard(...)) might help... but admittedly, is probably
not the correct solution.
Guess #2.
Maybe something like this:
XGrabKeyboard(display, win, True, GrabModeAsync, GrabModeSync,
CurrentTime);
instead of:
XGrabKeyboard(display, win, True, GrabModeAsync, GrabModeAsync,
CurrentTime);
..but I'm also not really sure I understand what's different about
GrabModeAsync vs GrabModeSync properly, but it sounds like Sync
might be better for this..
-Jeff
--
Nothing is as simple as it seems at first
Or as hopeless as it seems in the middle
Or as finished as it seems in the end
- References:
- [3ddesktop-dev] Re: Documentation / web page update
- From: Brad Wasson
- [3ddesktop-dev] Re: Documentation / web page update
- From: Saint-Michel Laurent
- [3ddesktop-dev] Re: Documentation / web page update
- From: Jeff Buck
- [3ddesktop-dev] Re: Documentation / web page update
- From: Saint-Michel Laurent
Other related posts:
- » [3ddesktop-dev] Losing keyboard focus problem
- » [3ddesktop-dev] Re: Losing keyboard focus problem
- » [3ddesktop-dev] Re: Losing keyboard focus problem
- » [3ddesktop-dev] Re: Losing keyboard focus problem
- [3ddesktop-dev] Re: Documentation / web page update
- From: Brad Wasson
- [3ddesktop-dev] Re: Documentation / web page update
- From: Saint-Michel Laurent
- [3ddesktop-dev] Re: Documentation / web page update
- From: Jeff Buck
- [3ddesktop-dev] Re: Documentation / web page update
- From: Saint-Michel Laurent