Note and workaround bugs in Operations.float

This commit is contained in:
Spencer Janssen 2007-07-05 19:52:13 +00:00
parent 2efa369dfc
commit 54c024583f
2 changed files with 10 additions and 2 deletions

View File

@ -29,7 +29,7 @@ import Graphics.X11.Xinerama (getScreenInfo)
import XMonad import XMonad
import Config import Config
import StackSet (new, floating, member) import StackSet (new, floating, member, findIndex, workspace, tag, current, visible)
import qualified StackSet as W import qualified StackSet as W
import Operations import Operations
@ -209,7 +209,11 @@ handle e@(ConfigureRequestEvent {ev_window = w}) = withDisplay $ \dpy -> do
ws <- gets windowset ws <- gets windowset
wa <- io $ getWindowAttributes dpy w wa <- io $ getWindowAttributes dpy w
if M.member w (floating ws) || not (member w ws) -- TODO temporary workaround for some bugs in float. Don't call 'float' on
-- windows that aren't visible, because it changes the focused screen
let vis = any ((== findIndex w ws) . Just . tag . workspace) (current ws : visible ws)
if (M.member w (floating ws) && vis)
|| not (member w ws)
then do io $ configureWindow dpy w (ev_value_mask e) $ WindowChanges then do io $ configureWindow dpy w (ev_value_mask e) $ WindowChanges
{ wc_x = ev_x e { wc_x = ev_x e
, wc_y = ev_y e , wc_y = ev_y e

View File

@ -473,6 +473,10 @@ sink :: Window -> X ()
sink = windows . W.sink sink = windows . W.sink
-- | Make a tiled window floating, using its suggested rectangle -- | 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 :: Window -> X ()
float w = withDisplay $ \d -> do float w = withDisplay $ \d -> do
ws <- gets windowset ws <- gets windowset