diff options
Diffstat (limited to 'XMonad/Operations.hs')
-rw-r--r-- | XMonad/Operations.hs | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/XMonad/Operations.hs b/XMonad/Operations.hs index 6bb2dae..a88ce06 100644 --- a/XMonad/Operations.hs +++ b/XMonad/Operations.hs @@ -159,8 +159,11 @@ setWMState w v = withDisplay $ \dpy -> do hide :: Window -> X () hide w = whenX (getsWindowState wsMapped w) $ withDisplay $ \d -> do cMask <- asks $ clientMask . config + frame <- getsWindowState wsFrame w io $ do selectInput d w (cMask .&. complement structureNotifyMask) - unmapWindow d w + selectInput d frame (cMask .&. complement structureNotifyMask) + unmapWindow d frame + selectInput d frame cMask selectInput d w cMask setWMState w iconicState -- this part is key: we increment the waitingUnmap counter to distinguish @@ -174,7 +177,21 @@ reveal :: Window -> X () reveal w = withDisplay $ \d -> do setWMState w normalState io $ mapWindow d w - whenX (isClient w) $ modifyWindowState (\ws -> ws { wsMapped = True }) w + whenX (isClient w) $ do + frame <- getsWindowState wsFrame w + io $ do + mapWindow d frame + (_, x, y, width, height, _, _) <- getGeometry d frame + moveResizeWindow d w 0 0 width height + -- send absolute ConfigureNotify + allocaXEvent $ \event -> do + setEventType event configureNotify + setConfigureEvent event w w (fi x) (fi y) (fi width) (fi height) 0 0 False + sendEvent d w False structureNotifyMask event + modifyWindowState (\ws -> ws { wsMapped = True }) w + where + fi :: (Integral a, Num b) => a -> b + fi = fromIntegral -- | Set some properties when we initially gain control of a window setInitialProperties :: Window -> X () @@ -204,12 +221,12 @@ clearEvents mask = withDisplay $ \d -> io $ do -- rectangle, including its border. tileWindow :: Window -> Rectangle -> X () tileWindow w r = withDisplay $ \d -> do - bw <- (fromIntegral . wa_border_width) <$> io (getWindowAttributes d w) + let bw = 0 -- give all windows at least 1x1 pixels let least x | x <= bw*2 = 1 | otherwise = x - bw*2 - io $ moveResizeWindow d w (rect_x r) (rect_y r) - (least $ rect_width r) (least $ rect_height r) + frame <- getsWindowState wsFrame w + io $ moveResizeWindow d frame (rect_x r) (rect_y r) (least $ rect_width r) (least $ rect_height r) -- --------------------------------------------------------------------- |