diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2011-09-07 19:35:59 +0200 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2011-09-07 19:35:59 +0200 |
commit | 6746d60e3f23a2abe4abe8bb0d26821b8faef8bd (patch) | |
tree | c52853873cf3c4399f129c65676165db2d349c21 /lib/Phi/Widget.hs | |
parent | 15d9304e052d2e5d4416e54a6fd24fbd0a252964 (diff) | |
download | phi-6746d60e3f23a2abe4abe8bb0d26821b8faef8bd.tar phi-6746d60e3f23a2abe4abe8bb0d26821b8faef8bd.zip |
Use new XHB backend for Taskbar
Diffstat (limited to 'lib/Phi/Widget.hs')
-rw-r--r-- | lib/Phi/Widget.hs | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/lib/Phi/Widget.hs b/lib/Phi/Widget.hs index 788abc2..25b08d4 100644 --- a/lib/Phi/Widget.hs +++ b/lib/Phi/Widget.hs @@ -37,6 +37,8 @@ import Graphics.Rendering.Cairo import Phi.Phi import Phi.X11.Atoms +import Debug.Trace + data Display = Display !Connection !Atoms @@ -56,19 +58,19 @@ data XMessage = UpdateScreens [(RECTANGLE, WINDOW)] deriving (Show, Typeable) unionArea :: RECTANGLE -> RECTANGLE -> Int -unionArea a b = fromIntegral $ uw*uh +unionArea a b = uw*uh where - uw = max 0 $ (min ax2 bx2) - (max ax1 bx1) - uh = max 0 $ (min ay2 by2) - (max ay1 by1) + uw = max 0 $ (min ax2 bx2) - fromIntegral (max ax1 bx1) + uh = max 0 $ (min ay2 by2) - fromIntegral (max ay1 by1) MkRECTANGLE ax1 ay1 aw ah = a MkRECTANGLE bx1 by1 bw bh = b - ax2 = ax1 + fromIntegral aw - ay2 = ay1 + fromIntegral ah + ax2 = fromIntegral ax1 + fromIntegral aw + ay2 = fromIntegral ay1 + fromIntegral ah - bx2 = bx1 + fromIntegral bw - by2 = by1 + fromIntegral bh + bx2 = fromIntegral bx1 + fromIntegral bw + by2 = fromIntegral by1 + fromIntegral bh data SurfaceSlice = SurfaceSlice !Int !Surface |