On 13 April 2012 19:12, Martti Kühne <mysat...@gmail.com> wrote: > after whining earlier on irc, I've got to put things straight here. > I have two monitors and most of the time I don't really care where the mouse > pointer is. using dwm with multiple monitors works great, as there is the > focusmon function, which I have assigned to a key to switch between monitors. > > The issue I was having with gedit was this: every now and then, gedit would > refuse to display a text cursor when I use the mouse to point, click and, at > the same time, get focus from a different screen. The only way of knowing > where > in the text the cursor was, was to blindly type something or press the > focusmon > key twice, which worked as a workaround for the issue. > > In the course of debugging this I also noticed the same can be achieved when > the focusmon key is used to switch to a window on the other screen and follow > with the mouse and come back again, returning focus to the screen where gedit > runs. Again, input is taken, blue border is drawn, but no text cursor is > shown. > > Well, I can imagine that it's easy to blame gedit for that inconsistency, > apparently qt applications do not suffer from this. > > Anyway, looking at dwm's codebase it isn't really clear when focus() is > called, > selmon is set and unfocus is called, and, focus() itself calls unfocus and > sets > selmon just in case. Needless to say, it made debugging a horrible task here.
True, the focus handling is one of the most sucking parts of dwm and X ;) > I have tried quite a lot of things which ultimately lead to the desired > behavior, and then tested things hunkwise to find the culprit after all; > turns out it's my regular use of focusmon() which actually triggers the bug in > the first place; the change that solved my issues can be found in [1]. > > tl:dr; improve focus behavior of at least anjuta and gedit [1] Applied for now, looking forward that someone starts whining that the next X client is broken now. Cheers, Anselm