diff options
author | Spencer Janssen <sjanssen@cse.unl.edu> | 2007-03-31 03:00:24 +0200 |
---|---|---|
committer | Spencer Janssen <sjanssen@cse.unl.edu> | 2007-03-31 03:00:24 +0200 |
commit | fe629abc3fe4e8c01ac1fb7b05ed794923055b9c (patch) | |
tree | f284f916c2eeb11f946bf587c3ae1b6e1fec63ba /Operations.hs | |
parent | fced38bbab219ec8306913831e358fa37e1b37fb (diff) | |
download | xmonad-fe629abc3fe4e8c01ac1fb7b05ed794923055b9c.tar.gz xmonad-fe629abc3fe4e8c01ac1fb7b05ed794923055b9c.tar.xz xmonad-fe629abc3fe4e8c01ac1fb7b05ed794923055b9c.zip |
Move safeFocus from Main to Operations
darcs-hash:20070331010024-a5988-73c72204cd204872dd7a2339c1e805e2a0578a58.gz
Diffstat (limited to '')
-rw-r--r-- | Operations.hs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Operations.hs b/Operations.hs index 9b0a229..c0e4450 100644 --- a/Operations.hs +++ b/Operations.hs @@ -136,6 +136,13 @@ withServerX f = withDisplay $ \dpy -> do f io $ ungrabServer dpy +safeFocus :: Window -> X () +safeFocus w = do ws <- gets workspace + if W.member w ws + then setFocus w + else do b <- isRoot w + when b setTopFocus + -- | Explicitly set the keyboard focus to the given window setFocus :: Window -> X () setFocus w = do |