summaryrefslogtreecommitdiffhomepage
path: root/src/Xmobar/X11/Draw.hs
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2022-09-11 02:27:56 +0100
committerjao <jao@gnu.org>2022-09-11 02:28:18 +0100
commitd0f547be5380ec14cc334b15a530ba869668581a (patch)
tree764bb33481073aff0f924df9dbce6375f5581995 /src/Xmobar/X11/Draw.hs
parent65f2bb18a372fc32a95c9887ba7a4006dc4ea24a (diff)
downloadxmobar-d0f547be5380ec14cc334b15a530ba869668581a.tar.gz
xmobar-d0f547be5380ec14cc334b15a530ba869668581a.tar.bz2
cairo: alpha (still pseudo, via xrender)
Diffstat (limited to 'src/Xmobar/X11/Draw.hs')
-rw-r--r--src/Xmobar/X11/Draw.hs11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/Xmobar/X11/Draw.hs b/src/Xmobar/X11/Draw.hs
index ea7fa95..643ec13 100644
--- a/src/Xmobar/X11/Draw.hs
+++ b/src/Xmobar/X11/Draw.hs
@@ -24,9 +24,11 @@ import Control.Monad.Reader
import Graphics.X11.Xlib hiding (Segment)
+import Xmobar.Config.Types
import Xmobar.Run.Parsers (Segment)
import Xmobar.Run.Actions (Action)
import Xmobar.X11.Types
+import Xmobar.X11.XRender (drawBackground)
#ifdef CAIRO
import Xmobar.X11.CairoDraw
@@ -45,10 +47,19 @@ drawInWin conf bound@(Rectangle _ _ wid ht) segments = do
r <- ask
let d = display r
w = window r
+
depth = defaultDepthOfScreen (defaultScreenOfDisplay d)
p <- liftIO $ createPixmap d w wid ht depth
gc <- liftIO $ createGC d w
liftIO $ setGraphicsExposures d gc False
+
+#if defined(XFT) || defined(CAIRO)
+ let conf = config r
+ alph = alpha conf
+ when (alph < 255)
+ (liftIO $ drawBackground d p (bgColor conf) alph (Rectangle 0 0 wid ht))
+#endif
+
#ifdef CAIRO
res <- drawInPixmap p wid ht segments
#else