Ryan McBride [Thu, 29 Oct 2009 11:16:33 +0000 (11:16 +0000)]
Some more subtleties for the focus handling code. In particular:
- A global last_focus_event helps us to determine whether another process
is playing with focus without telling us.
- merge focusin and focusout into a single focusevent, handle focus change
events triggered by synergy.
- Fix focus issues when entering a fullstack window from another region, by
checking to see which ws the focus is coming from before ignoring the
event.
Ryan McBride [Tue, 27 Oct 2009 10:49:47 +0000 (10:49 +0000)]
remove the ev->state check in enternotify()
ev->state indicates the state of the buttons and modifier keys, so it's not
just workspace changes but any time these buttons are down. This heuristic
breaks focus with mouse buttons down and when creating new terminals with
m-s-enter, among other things.
Marco Peereboom [Fri, 23 Oct 2009 20:33:53 +0000 (20:33 +0000)]
Add simple heuristic to max_stack focus to deal with new event reality.
This mostly uses the same logic as a normal stack but it detects if the
previous window got unmapped and goes back to the parent. The rest is
the same code as stacked focusing.
Marco Peereboom [Fri, 23 Oct 2009 16:39:45 +0000 (16:39 +0000)]
Fix the damned enternotify code for real.
Weed out VirtualNotify (switch ws and border crossings) and InferiorNotify
(focus on self, aka touching its own border).
Then check for ConfigureNotify to see if a window is being deleted or moved
to another work space.
This is the smaller hammer for the QLength trick that used to be in there.
If we still have focus issues we need to work those but this is worth
going in.
Ryan McBride [Fri, 23 Oct 2009 06:24:18 +0000 (06:24 +0000)]
Remove over-eager optimization in focus_magic().
This win == win->ws->focus check makes scrotwm forget the correct
focus across workspace changes. Unnecessary focus changes are prevented
by the XGetInputFocus() check anyways.
Marco Peereboom [Thu, 15 Oct 2009 20:42:59 +0000 (20:42 +0000)]
Remove all focus code from functions and replace it with a single function.
This works reasonably well but all the corner cases now need to be built.
Getting it in because it was becomming unwieldly.
As fas as I know this fixes all use after free issues. It is mean in that
it paints the old entries and has several aborts ready to go when something
bad happens.
Marco Peereboom [Mon, 12 Oct 2009 04:09:17 +0000 (04:09 +0000)]
Large change to try to fix programs like roxterm that need more wm love.
Really they are just a bunch of needy children but oh well.
Remove ws->restack since it wasn't used.
Add configreq_win to send syntetic configure requests.
Remove some callbacks that really made no difference (unmap and destroy)
Make XConfigureWindow only be called when necessary.
Fix mplayer that was disapearing after fullscreen.
Marco Peereboom [Sat, 10 Oct 2009 23:24:55 +0000 (23:24 +0000)]
use different heuristic to determine if a window needs to be unmanaged
outside of the normal handling. Not sure if this covers all cases but
I can't recreate holes in the stacker or crashes when stressing.
Marco Peereboom [Thu, 8 Oct 2009 04:40:56 +0000 (04:40 +0000)]
Set withdrawn sate for unmanaged windows. We needed it after all for
restarting the wm.
Add more paranoia around pointers in switchws.
Remove some dup code in the restart wm function.
Marco Peereboom [Wed, 7 Oct 2009 02:38:38 +0000 (02:38 +0000)]
Unfuck java by working around several java issues.
Implement WM_TAKE_FOCUS.
Make transients always the focus when entering either the parent or the
transient window itself.
Marco Peereboom [Mon, 5 Oct 2009 17:03:47 +0000 (17:03 +0000)]
Fix stress issue when keeping ctrl-d pressed when deleting 10 or so
windows. It comes down to events being tossed by the x server causing
dead windows to not be removed from the managed list. Apply a huge hammer
by removing the dead windows from the list when counting them for stacking
purposes.
Undo some previous added synchronization code that was not necessary but
had given me the illusion of serializing some things.
Marco Peereboom [Sun, 4 Oct 2009 05:58:27 +0000 (05:58 +0000)]
Add some serialization. Prevents some crashes under extreme load.
Not happy with it yet but it beats shitting X. This will never be seen
under normal load.