packages feed

gtk-sni-tray 0.1.6.0 → 0.1.6.2

raw patch · 3 files changed

+28/−13 lines, 3 files

Files

app/Main.hs view
@@ -120,6 +120,13 @@   <> help "Start a Watcher to handle SNI registration if one does not exist"   ) +noStrutP :: Parser Bool+noStrutP =+  switch+  (  long "no-strut"+  <> help "Do not set strut properties for the gtk window"+  )+ barLengthP :: Parser Rational barLengthP =   option auto@@ -154,11 +161,12 @@              -> Maybe String              -> Bool              -> Bool+             -> Bool              -> Rational              -> Rational              -> IO () buildWindows pos align size padding monitors priority maybeColorString expand-             startWatcher length overlayScale = do+             startWatcher noStrut length overlayScale = do   Gtk.init Nothing   logger <- getLogger "StatusNotifier"   saveGlobalLogger $ setLevel priority logger@@ -208,7 +216,8 @@             , trayOverlayScale = overlayScale             }         window <- Gtk.windowNew Gtk.WindowTypeToplevel-        setupStrutWindow config window+        when (not noStrut) $+             setupStrutWindow config window         maybe           (makeWindowTransparent window)           (getColor >=>@@ -228,7 +237,7 @@ parser =   buildWindows <$> positionP <*> alignmentP <*> sizeP <*> paddingP <*>   monitorNumberP <*> logP <*> colorP <*> expandP <*> startWatcherP <*>-  barLengthP <*> overlayScaleP+  noStrutP <*> barLengthP <*> overlayScaleP  versionOption :: Parser (a -> a) versionOption = infoOption
gtk-sni-tray.cabal view
@@ -1,13 +1,11 @@ cabal-version: 1.12 --- This file has been generated from package.yaml by hpack version 0.31.1.+-- This file has been generated from package.yaml by hpack version 0.34.4. -- -- see: https://github.com/sol/hpack------ hash: 9ae75bcf04140e891f7319a5d4f55a83c2a0aa11aee489abb939acfb3853eb0d  name:           gtk-sni-tray-version:        0.1.6.0+version:        0.1.6.2 synopsis:       A standalone StatusNotifierItem/AppIndicator tray description:    Please see the README on Github at <https://github.com/IvanMalison/gtk-sni-tray#readme> category:       System@@ -35,6 +33,8 @@       Paths_gtk_sni_tray   hs-source-dirs:       src+  pkgconfig-depends:+      gtk+-3.0   build-depends:       base >=4.7 && <5     , bytestring@@ -60,8 +60,6 @@     , transformers     , transformers-base >=0.4     , unix-  pkgconfig-depends:-      gtk+-3.0   default-language: Haskell2010  executable gtk-sni-tray-standalone
src/StatusNotifier/Tray.hs view
@@ -1,5 +1,6 @@ {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE OverloadedLabels #-}+{-# LANGUAGE CPP #-} module StatusNotifier.Tray where  import           Control.Concurrent.MVar as MV@@ -112,7 +113,8 @@   then do     let targetName = if hasPanelIcon then panelName else name     trayLogger DEBUG $ printf "Found icon %s in theme" name-    iconThemeLoadIcon themeForIcon targetName size themeLoadFlags+    catchAny (iconThemeLoadIcon themeForIcon targetName size themeLoadFlags)+             (const $ pure Nothing)    else do     trayLogger DEBUG $ printf "Trying to load icon %s as filepath" name@@ -122,7 +124,12 @@     maybeFile <- if fileExists     then return $ Just nameString     else fmap join $ sequenceA $ getIconPathFromThemePath nameString <$> themePath-    sequenceA $ pixbufNewFromFile <$> maybeFile+#if MIN_VERSION_gi_gdkpixbuf(2,0,26)+    let handleResult = fmap join . sequenceA+#else+    let handleResult = sequenceA+#endif+    handleResult $ pixbufNewFromFile <$> maybeFile  getIconPathFromThemePath :: String -> String -> IO (Maybe String) getIconPathFromThemePath name themePath = if name == "" then return Nothing else do@@ -256,8 +263,9 @@                           in return (thisTime, thisTime /= previous)                          trayLogger DEBUG $-                                   printf "Allocating image size %s, width %s, \-                                           \ height %s, resize %s"+                                   printf+                                   ("Allocating image size %s, width %s," <>+                                    " height %s, resize %s")                                    (show size)                                    (show actualWidth)                                    (show actualHeight)