mirror of
https://github.com/xmonad/xmonad.git
synced 2025-08-07 23:51:52 -07:00
handle MappingNotifyEvent properly, and missing test in MapRequestEvent. firefox still won't take the keyboard though
This commit is contained in:
15
Main.hs
15
Main.hs
@@ -109,18 +109,17 @@ grabKeys dpy r = forM_ (M.keys keys) $ \(m,s) -> io $ do
|
|||||||
-- [UnmapNotify] = unmapnotify
|
-- [UnmapNotify] = unmapnotify
|
||||||
--
|
--
|
||||||
handle :: Event -> W ()
|
handle :: Event -> W ()
|
||||||
handle (MapRequestEvent {window = w}) = manage w
|
handle (MapRequestEvent {window = w}) = withDisplay $ \dpy -> do
|
||||||
|
wa <- io $ getWindowAttributes dpy w
|
||||||
|
when (not (waOverrideRedirect wa)) $ manage w
|
||||||
|
|
||||||
handle (DestroyWindowEvent {window = w}) = unmanage w
|
handle (DestroyWindowEvent {window = w}) = unmanage w
|
||||||
handle (UnmapEvent {window = w}) = unmanage w
|
handle (UnmapEvent {window = w}) = unmanage w
|
||||||
|
|
||||||
handle (MappingNotifyEvent {window = w}) = do
|
handle e@(MappingNotifyEvent {window = w}) = do
|
||||||
trace $ "Got mapping notify event for window: " ++ show w
|
let m = (request e, first_keycode e, count e)
|
||||||
|
|
||||||
{-
|
|
||||||
, mapping= m@(r,_,_)}) = do
|
|
||||||
io $ refreshKeyboardMapping m
|
io $ refreshKeyboardMapping m
|
||||||
when (r == mappingKeyboard) $ withDisplay $ \d -> grabKeys d w
|
when (request e == mappingKeyboard) $ withDisplay $ flip grabKeys w
|
||||||
-}
|
|
||||||
|
|
||||||
handle (KeyEvent {event_type = t, state = m, keycode = code})
|
handle (KeyEvent {event_type = t, state = m, keycode = code})
|
||||||
| t == keyPress = withDisplay $ \dpy -> do
|
| t == keyPress = withDisplay $ \dpy -> do
|
||||||
|
Reference in New Issue
Block a user