From e3824687c7af2ccd412572413c3478715104fd7c Mon Sep 17 00:00:00 2001 From: slotThe Date: Fri, 29 Oct 2021 09:43:13 +0200 Subject: [PATCH] X.Operations: Silently catch in setWindowBorderWithFallback While we catch the exception that `getWindowAttributes` can throw in `setWindowBorderWithFallback`, we immediately turn around and print the error to stderr. Since this exception is raised every time a window is closed[1] , it clutters stderr and may even confuse users as to why xmonad is throwing these exceptions. [1]: Depending on how the window is closed, we either have no way of running `windows` on our own (say, the window is closed by a keybinding of the program itself), or the focus change (and thus the call to `windows`) runs before we can handle the DestroyWindowEvent. --- src/XMonad/Operations.hs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/XMonad/Operations.hs b/src/XMonad/Operations.hs index 05978cc..2458a71 100644 --- a/src/XMonad/Operations.hs +++ b/src/XMonad/Operations.hs @@ -254,8 +254,7 @@ setWindowBorderWithFallback dpy w color basic = io $ setWindowBorder dpy w pixel where fallback :: C.SomeException -> IO () - fallback e = do hPrint stderr e >> hFlush stderr - setWindowBorder dpy w basic + fallback _ = setWindowBorder dpy w basic -- | Hide a window by unmapping it and setting Iconified. hide :: Window -> X ()