Remember if focus changes were caused by mouse actions or by key commands

If the user used the mouse to change window focus (moving into or clicking on a
window), this should be handled differently than focus changes due to keyboard
commands. Specifically, it's inappropriate to discard window enter/leave events
while the mouse is moving. This fixes the bug where a fast mouse motion across
multiple windows resulted in the wrong window keeping focus.

It's also helpful information for contrib modules such as UpdatePointer - it's
supposed to move the mouse pointer only in response to keyboard actions, not if
the user was moving the mouse.
This commit is contained in:
Klaus Weidner
2008-05-02 17:56:03 +00:00
parent ba3987f299
commit d8d636e573
3 changed files with 8 additions and 3 deletions

View File

@@ -69,6 +69,7 @@ data XConf = XConf
-- ^ a mapping of key presses to actions
, buttonActions :: !(M.Map (KeyMask, Button) (Window -> X ()))
-- ^ a mapping of button presses to actions
, mouseFocused :: !Bool -- ^ was refocus caused by mouse action?
}
-- todo, better name