diff options
author | Karsten Schoelzel <kuser@gmx.de> | 2007-09-10 11:03:29 +0200 |
---|---|---|
committer | Karsten Schoelzel <kuser@gmx.de> | 2007-09-10 11:03:29 +0200 |
commit | df9292b3d2ccb071af89b4576ebddc5f97db71ab (patch) | |
tree | f08c616430400f3d96aa120825da4e27eac8c004 /Operations.hs | |
parent | 0ddfabc605c890cda31fe7104cedaa6b6684ed25 (diff) | |
download | xmonad-df9292b3d2ccb071af89b4576ebddc5f97db71ab.tar.gz xmonad-df9292b3d2ccb071af89b4576ebddc5f97db71ab.tar.xz xmonad-df9292b3d2ccb071af89b4576ebddc5f97db71ab.zip |
Fix float behaviour, add shiftWin.
First, if float is called with window which is on a hidden workspace,
then the window will remain on that hidden workspace.
Now the focus should change more as expected:
float w
darcs-hash:20070910090329-eb3a1-ae150bf783b36fb4811e92d81b4917066c8733b7.gz
Diffstat (limited to 'Operations.hs')
-rw-r--r-- | Operations.hs | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/Operations.hs b/Operations.hs index d7f6639..39dc253 100644 --- a/Operations.hs +++ b/Operations.hs @@ -472,10 +472,6 @@ sink :: Window -> X () sink = windows . W.sink -- | Make a tiled window floating, using its suggested rectangle --- --- TODO: float changes the set of visible workspaces when we call it for an --- invisible window -- this should not happen. See 'temporary workaround' in --- the handler for ConfigureRequestEvent also. float :: Window -> X () float w = withDisplay $ \d -> do ws <- gets windowset @@ -485,12 +481,14 @@ float w = withDisplay $ \d -> do sr = screenRect . W.screenDetail $ sc sw = W.tag . W.workspace $ sc bw = fi . wa_border_width $ wa - - windows $ maybe id W.focusWindow (W.peek ws) . W.shift sw . W.focusWindow w . W.float w - (W.RationalRect ((fi (wa_x wa) - fi (rect_x sr)) % fi (rect_width sr)) - ((fi (wa_y wa) - fi (rect_y sr)) % fi (rect_height sr)) - (fi (wa_width wa + bw*2) % fi (rect_width sr)) - (fi (wa_height wa + bw*2) % fi (rect_height sr))) + rr = (W.RationalRect ((fi (wa_x wa) - fi (rect_x sr)) % fi (rect_width sr)) + ((fi (wa_y wa) - fi (rect_y sr)) % fi (rect_height sr)) + (fi (wa_width wa + bw*2) % fi (rect_width sr)) + (fi (wa_height wa + bw*2) % fi (rect_height sr))) + + if maybe False (`elem` (map W.tag . W.hidden $ ws)) (W.findIndex w ws) + then windows $ W.float w rr + else windows $ maybe id W.focusWindow (W.peek ws) . W.shiftWin sw w . W.float w rr where fi x = fromIntegral x pointWithin :: Integer -> Integer -> Rectangle -> Bool pointWithin x y r = x >= fi (rect_x r) && |