From 5afc1880d1289c9c3dc19e6b6a21e09ba4a959f9 Mon Sep 17 00:00:00 2001 From: ndwarshuis Date: Wed, 1 Apr 2020 17:15:40 -0400 Subject: [PATCH] FIX actually check for badwindow errors --- app/Main.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/Main.hs b/app/Main.hs index 6a7a56e..1f71ead 100644 --- a/app/Main.hs +++ b/app/Main.hs @@ -23,7 +23,7 @@ -- will not be updated or restarted. Furthermore, it is outside the scope of -- this program to bind multiple xcape mappings with multiple keymaps -module Main where +module Main (main) where import Control.Monad (forM_, forever, void, when) import Control.Monad.Reader @@ -164,7 +164,8 @@ handle _ = return () -- | Given a window, return its app name getAppName :: Window -> XMan AppName -getAppName w = asks display >>= io . fmap resName . flip getClassHint w +getAppName w = io . fmap resName . permitBadWindow . flip getClassHint w =<< + asks display -- | Given an IO action (which is assumed to call an XLib function that may -- throw an error), attach an error handler before performing the action and