mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-05-19 03:20:21 -07:00
X.A.TreeSelect: Only swap green/blue for X11-xft < 0.3.3
The issue was fixed upstream in 0.3.3:24f6275791
24f6275791
^ (it is yet to be uploaded to Hackage, Clemens lost his Hackage credentials :-)) Related: https://github.com/xmonad/xmonad-contrib/pull/486 Related: 46f24bb27ec4 ("X.A.TreeSelect: Fix swapped green/blue in foreground when using Xft")
This commit is contained in:
parent
8cbe3ecd48
commit
57674eb545
@ -655,8 +655,16 @@ drawStringXMF display window visual colormap gc font col x y text = case font of
|
||||
--
|
||||
-- Note that it uses short to represent its components
|
||||
fromARGB :: Pixel -> XRenderColor
|
||||
fromARGB x = XRenderColor (fromIntegral $ 0xff00 .&. shiftR x 8) -- red
|
||||
(fromIntegral $ 0xff00 .&. shiftL x 8) -- blue (swapped with green as a workaround for the
|
||||
(fromIntegral $ 0xff00 .&. x) -- green faulty Storable instance in X11-xft <= 0.3.1)
|
||||
(fromIntegral $ 0xff00 .&. shiftR x 16) -- alpha
|
||||
fromARGB x =
|
||||
#if MIN_VERSION_X11_xft(0, 3, 3)
|
||||
XRenderColor r g b a
|
||||
#else
|
||||
-- swapped green/blue as a workaround for the faulty Storable instance in X11-xft < 0.3.3
|
||||
XRenderColor r b g a
|
||||
#endif
|
||||
where
|
||||
r = fromIntegral $ 0xff00 .&. shiftR x 8
|
||||
g = fromIntegral $ 0xff00 .&. x
|
||||
b = fromIntegral $ 0xff00 .&. shiftL x 8
|
||||
a = fromIntegral $ 0xff00 .&. shiftR x 16
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user