Virtual desktop underlay for Wayland and X11
git clone https://github.com/m-col/xanadu
Files | Refs | Readme | License

Commit 21135d490104bc6355fd2a2f019998e27bd6786f
Parent: f7ff274355999e98090fd2d711f96f3f4f664744
Author: mcol <mcol@posteo.net>
Date: 2021-11-03 16:06:12 +0000
Committer: mcol <mcol@posteo.net>
Committed: 2021-11-03 16:06:12 +0000

Make main less penetrable

src/Main.hs Modified

@@ -7,6 +7,7 @@
 import Style (initStyle)
 import Window (initWindow)
 
+import Control.Monad ((<=<))
 import Data.GI.Base
 import qualified GI.Gio as Gio
 import qualified GI.Gtk as Gtk
@@ -22,10 +23,5 @@
     return ()
 
 activateApp :: Gtk.Application -> IO ()
-activateApp app = do
-    win <- initWindow app
-    initStyle win
-    iconView <- initIcons win
-    #add win iconView
-    #showAll win
-    return ()
+activateApp =
+    mconcat . sequenceA [initStyle, initIcons, Gtk.widgetShowAll] <=< initWindow

src/Icons.hs Modified

@@ -21,7 +21,7 @@
 import qualified GI.Gio as Gio
 import qualified GI.Gtk as Gtk
 
-initIcons :: Gtk.ApplicationWindow -> IO Gtk.IconView
+initIcons :: Gtk.ApplicationWindow -> IO ()
 initIcons win = do
     pixbufGType <- glibType @Pixbuf.Pixbuf
     listStore <- Gtk.listStoreNew [GType.gtypeString, pixbufGType]
@@ -39,7 +39,8 @@
         , #activateOnSingleClick := True
         ]
     on iconView #itemActivated $ onItemActivated listStore root
-    return iconView
+    Gtk.containerAdd win iconView
+    return ()
 
 -- Root folder is $(XDG_DESKTOP_DIR:-$HOME/Desktop)
 getRoot :: IO FilePath