summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2023-02-07 04:18:37 +0100
committertv <tv@krebsco.de>2023-02-07 04:25:35 +0100
commited526491aa05ee173095bcb519cf2d64fa40fb46 (patch)
tree37863b214418feff7ec92a21e37a126903cd15a8 /lib
parent9f8d54bce82fb61c428996a9367ec1579410ff32 (diff)
move moveWindowToDesktop to Graphics.X11.EWMH
Diffstat (limited to 'lib')
-rw-r--r--lib/Graphics/X11/EWMH.hs9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/Graphics/X11/EWMH.hs b/lib/Graphics/X11/EWMH.hs
index 856cfdb..fe9217a 100644
--- a/lib/Graphics/X11/EWMH.hs
+++ b/lib/Graphics/X11/EWMH.hs
@@ -48,6 +48,15 @@ getWindowTitle dpy w =
getWindowPropertyString dpy _NET_WM_NAME w <|>
getWindowPropertyString dpy _WM_NAME w
+moveWindowToDesktop :: Display -> Window -> CLong -> IO ()
+moveWindowToDesktop dpy w s =
+ allocaXEvent $ \e -> do
+ setEventType e clientMessage
+ setClientMessageEvent' e (fromIntegral w) _NET_WM_DESKTOP 32 [fromIntegral s,0,0,0,0]
+ sendEvent dpy (fromIntegral w) True mask e
+ where
+ mask = substructureNotifyMask
+
setDesktopNames :: [String] -> Display -> IO ()
setDesktopNames names dpy = do
changeProperty8 dpy r a t propModeReplace names'