mirror of
https://github.com/xmonad/xmonad.git
synced 2025-05-19 08:30:21 -07:00
clean up Main.hs slightly
This commit is contained in:
parent
9b429f4f41
commit
225a2e89a3
18
Main.hs
18
Main.hs
@ -157,14 +157,13 @@ handle e@(MappingNotifyEvent {ev_window = w}) = do
|
|||||||
when (ev_request e == mappingKeyboard) $ withDisplay $ io . flip grabKeys w
|
when (ev_request e == mappingKeyboard) $ withDisplay $ io . flip grabKeys w
|
||||||
|
|
||||||
-- click on an unfocused window, makes it focused on this workspace
|
-- click on an unfocused window, makes it focused on this workspace
|
||||||
handle (ButtonEvent { ev_window = w, ev_subwindow = subw, ev_event_type = t, ev_state = m, ev_button = b })
|
handle e@(ButtonEvent {ev_window = w,ev_event_type = t,ev_button = b })
|
||||||
| t == buttonPress = do isr <- isRoot w
|
| t == buttonPress = do
|
||||||
-- If it's the root window, then it's something we
|
isr <- isRoot w
|
||||||
-- grabbed in grabButtons. Otherwise, it's
|
if isr then whenJust (M.lookup (cleanMask (ev_state e), b) mouseBindings) ($ ev_subwindow e)
|
||||||
-- click-to-focus.
|
else focus w
|
||||||
if isr
|
-- If it's the root window, then it's something we
|
||||||
then whenJust (M.lookup (cleanMask m, b) mouseBindings) ($ subw)
|
-- grabbed in grabButtons. Otherwise, it's click-to-focus.
|
||||||
else focus w
|
|
||||||
|
|
||||||
-- entered a normal window, makes this focused.
|
-- entered a normal window, makes this focused.
|
||||||
handle e@(CrossingEvent {ev_window = w, ev_event_type = t})
|
handle e@(CrossingEvent {ev_window = w, ev_event_type = t})
|
||||||
@ -195,7 +194,8 @@ handle e@(ConfigureRequestEvent {ev_window = w}) = withDisplay $ \dpy -> do
|
|||||||
else io $ allocaXEvent $ \ev -> do
|
else io $ allocaXEvent $ \ev -> do
|
||||||
setEventType ev configureNotify
|
setEventType ev configureNotify
|
||||||
setConfigureEvent ev w w
|
setConfigureEvent ev w w
|
||||||
(wa_x wa) (wa_y wa) (wa_width wa) (wa_height wa) (ev_border_width e) none (wa_override_redirect wa)
|
(wa_x wa) (wa_y wa) (wa_width wa)
|
||||||
|
(wa_height wa) (ev_border_width e) none (wa_override_redirect wa)
|
||||||
sendEvent dpy w False 0 ev
|
sendEvent dpy w False 0 ev
|
||||||
io $ sync dpy False
|
io $ sync dpy False
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user