summaryrefslogtreecommitdiffstats
path: root/src/pager.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/pager.hs')
-rw-r--r--src/pager.hs21
1 files changed, 5 insertions, 16 deletions
diff --git a/src/pager.hs b/src/pager.hs
index f5c7e0d..dbfc6b0 100644
--- a/src/pager.hs
+++ b/src/pager.hs
@@ -9,7 +9,7 @@ import Blessings.Text (Blessings(Plain,SGR),pp)
import Control.Concurrent
import Control.Monad (forM)
import Control.Monad (forever)
-import Data.Bits ((.|.),testBit)
+import Data.Bits (testBit)
import Data.Default (def)
import Data.Function ((&))
import Data.List.Extra ((!!?))
@@ -17,7 +17,6 @@ import Data.Maybe (catMaybes,fromMaybe)
import Data.Monoid.Extra (mintercalate)
import Data.Set (Set)
import Data.Text (Text)
-import Foreign.C.Types (CLong)
import Much.Screen (Screen(Screen), withScreen)
import Pager.Types
import Scanner
@@ -223,31 +222,21 @@ main = do
Just s = name `List.elemIndex` map workspace_name workspaces
in
--debug (name, s, activeWindow, window) >>
- --windowToDesktop d activeWindow (fromIntegral s)
- windowToDesktop d (fromIntegral window) (fromIntegral s)
+ --X11.moveWindowToDesktop d activeWindow (fromIntegral s)
+ X11.moveWindowToDesktop d (fromIntegral window) (fromIntegral s)
ShiftWindowToAndViewWorkspace window -> do
-- XXX [xmonad-http] wmpost manager ("/workspace/" <> Text.unpack name <> "/shiftview/" <> show wid) () :: IO (Maybe ())
X11.withDefaultDisplay $ \d -> do
let Just s = name `List.elemIndex` map workspace_name workspaces
- --windowToDesktop d activeWindow (fromIntegral s)
- windowToDesktop d (fromIntegral window) (fromIntegral s)
+ --X11.moveWindowToDesktop d activeWindow (fromIntegral s)
+ X11.moveWindowToDesktop d (fromIntegral window) (fromIntegral s)
X11.switchToDesktop d (fromIntegral s)
_ ->
return ()
-windowToDesktop :: X11.Display -> X11.Window -> CLong -> IO ()
-windowToDesktop d w s =
- X11.allocaXEvent $ \e -> do
- X11.setEventType e X11.clientMessage
- X11.setClientMessageEvent' e (fromIntegral w) X11._NET_WM_DESKTOP 32 [fromIntegral s,0,0,0,0]
- X11.sendEvent d (fromIntegral w) True mask e
- where
- mask = X11.substructureRedirectMask .|. X11.substructureNotifyMask
-
-
run :: Handle -> IO Event -> State -> IO (State, Action)
run o getEvent = rec . Right where
rec = \case