diff options
author | Jason Creighton <jcreigh@gmail.com> | 2007-06-11 03:54:37 +0200 |
---|---|---|
committer | Jason Creighton <jcreigh@gmail.com> | 2007-06-11 03:54:37 +0200 |
commit | aacba82c15c390c980a62a4bebf7b1d0244ecd9a (patch) | |
tree | 0ad3224278d96c178f9d559d0a1ba2c974476e96 | |
parent | 252d55826ac2ddcf879d8cbf8a5af2d63b043fef (diff) | |
download | XMonadContrib-aacba82c15c390c980a62a4bebf7b1d0244ecd9a.tar.gz XMonadContrib-aacba82c15c390c980a62a4bebf7b1d0244ecd9a.tar.xz XMonadContrib-aacba82c15c390c980a62a4bebf7b1d0244ecd9a.zip |
use safe peek instead of unsafe focus
Fixes crashing bug with Xinerama where you have a tabbed layout on one screen
and attempt to switch to an empty workspace on the other.
darcs-hash:20070611015437-b9aa7-19e093acecdf9c248a965625b226b82b1422ffd0.gz
-rw-r--r-- | Tabbed.hs | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -10,7 +10,7 @@ module XMonadContrib.Tabbed ( tabbed ) where -- defaultLayouts = [ tabbed -- , ... ] -import Control.Monad ( forM ) +import Control.Monad ( forM, liftM ) import Control.Monad.State ( gets ) import Graphics.X11.Xlib @@ -32,8 +32,7 @@ dolay sc@(Rectangle x y wid _) ws = maketab (t,w) = newDecoration t 1 0x000000 0x777777 (drawtab t w) (focus w) drawtab r@(Rectangle _ _ wt ht) w d w' gc = do nw <- getName w - focusw <- gets (W.focus . W.stack . W.workspace . W.current . windowset) - let tabcolor = if focusw == w then 0xBBBBBB else 0x888888 + tabcolor <- (maybe 0x888888 (\focusw -> if focusw == w then 0xBBBBBB else 0x888888) . W.peek) `liftM` gets windowset io $ setForeground d gc tabcolor io $ fillRectangles d w' gc [Rectangle 0 0 wt ht] io $ setForeground d gc 0x000000 |