From ed5c8667b1e397094186bfa227cd76b29553204f Mon Sep 17 00:00:00 2001 From: Tomas Janousek Date: Tue, 5 Jul 2022 23:09:10 +0100 Subject: [PATCH] Revert "Revert "Merge pull request #350 from Thiago4532/opaque-window-border"" This reverts commit e5a258f19c0ae715c36c3d5646486578f4cdf94d. https://github.com/xmonad/xmonad-contrib/pull/731 fixes the WindowNavigation issue with alpha channels, so we can re-enable alpha support. --- src/XMonad/Operations.hs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/XMonad/Operations.hs b/src/XMonad/Operations.hs index d012436..e69b1a9 100644 --- a/src/XMonad/Operations.hs +++ b/src/XMonad/Operations.hs @@ -265,7 +265,7 @@ setWindowBorderWithFallback :: Display -> Window -> String -> Pixel -> X () setWindowBorderWithFallback dpy w color basic = io $ C.handle fallback $ do wa <- getWindowAttributes dpy w - pixel <- color_pixel . fst <$> allocNamedColor dpy (wa_colormap wa) color + pixel <- setPixelSolid . color_pixel . fst <$> allocNamedColor dpy (wa_colormap wa) color setWindowBorder dpy w pixel where fallback :: C.SomeException -> IO () @@ -519,10 +519,14 @@ cleanMask km = do nlm <- gets numberlockMask return (complement (nlm .|. lockMask) .&. km) +-- | Set the 'Pixel' alpha value to 255. +setPixelSolid :: Pixel -> Pixel +setPixelSolid p = p .|. 0xff000000 + -- | Get the 'Pixel' value for a named color. initColor :: Display -> String -> IO (Maybe Pixel) initColor dpy c = C.handle (\(C.SomeException _) -> return Nothing) $ - Just . color_pixel . fst <$> allocNamedColor dpy colormap c + Just . setPixelSolid . color_pixel . fst <$> allocNamedColor dpy colormap c where colormap = defaultColormap dpy (defaultScreen dpy) ------------------------------------------------------------------------