From ed526491aa05ee173095bcb519cf2d64fa40fb46 Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 7 Feb 2023 04:18:37 +0100 Subject: move moveWindowToDesktop to Graphics.X11.EWMH --- lib/Graphics/X11/EWMH.hs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'lib/Graphics/X11') 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' -- cgit v1.2.3