X.H.ServerMode: Only read the first ClientMessage data item

Atoms are at most 32-bit even on 64-bit platforms, per the X protocol,
despite them being stored in a CLong. Even if they weren't (and they
are, see /usr/include/X11/Xproto.h and
https://stackoverflow.com/a/23265984/3407728), xmonadctl isn't unpacking
the CLong into multiple data items.
This commit is contained in:
Tomas Janousek 2021-02-11 21:26:57 +00:00
parent d70128418b
commit 52717dd5fb

View File

@ -93,7 +93,7 @@ serverModeEventHookF key func (ClientMessageEvent {ev_message_type = mt, ev_data
d <- asks display d <- asks display
atm <- io $ internAtom d key False atm <- io $ internAtom d key False
when (mt == atm && dt /= []) $ do when (mt == atm && dt /= []) $ do
let atom = fromIntegral $ toInteger $ foldr1 (\a b -> a + (b*2^(32::Int))) dt let atom = fromIntegral (head dt)
cmd <- io $ getAtomName d atom cmd <- io $ getAtomName d atom
case cmd of case cmd of
Just command -> func command Just command -> func command