From d19e4dceaf8e3559884da3c9afb536b3258d7bc7 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Wed, 30 Jun 2021 09:08:20 -0400 Subject: [PATCH] refactor --- .../desktopish/taffybar/taffybar-srid/Main.hs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/features/desktopish/taffybar/taffybar-srid/Main.hs b/features/desktopish/taffybar/taffybar-srid/Main.hs index 2c06f27..fe38e92 100644 --- a/features/desktopish/taffybar/taffybar-srid/Main.hs +++ b/features/desktopish/taffybar/taffybar-srid/Main.hs @@ -93,17 +93,17 @@ enableDebugLogging = do getLogger "System.Taffybar.Widget.Battery" ] +-- More reliable than taffybar's version: -- https://github.com/taffybar/taffybar/issues/403#issuecomment-870403234 - -handleException :: WindowIconPixbufGetter -> WindowIconPixbufGetter -handleException getter = \size windowData -> - ReaderT $ \c -> - catch (runReaderT (getter size windowData) c) $ \(_ :: SomeException) -> - return Nothing - myGetWindowIconPixbuf :: WindowIconPixbufGetter myGetWindowIconPixbuf = scaledWindowIconPixbufGetter $ handleException getWindowIconPixbufFromDesktopEntry <|||> handleException getWindowIconPixbufFromClass - <|||> handleException getWindowIconPixbufFromEWMH \ No newline at end of file + <|||> handleException getWindowIconPixbufFromEWMH + where + handleException :: WindowIconPixbufGetter -> WindowIconPixbufGetter + handleException getter = \size windowData -> + ReaderT $ \c -> + catch (runReaderT (getter size windowData) c) $ \(_ :: SomeException) -> + return Nothing