fix(strixi-minaj): stabilize kanshi tray behavior
This commit is contained in:
26
nixos/patches/kanshi-sni-keep-menu-root-alive.patch
Normal file
26
nixos/patches/kanshi-sni-keep-menu-root-alive.patch
Normal file
@@ -0,0 +1,26 @@
|
||||
--- a/src/Kanshi/SNI.hs
|
||||
+++ b/src/Kanshi/SNI.hs
|
||||
@@ -42,6 +42,7 @@
|
||||
data SNIState = SNIState
|
||||
{ sniConnection :: MVar (Maybe KanshiConnection)
|
||||
, sniAppState :: MVar AppState
|
||||
+ , sniMenuRoot :: MVar Dbusmenu.Menuitem
|
||||
, sniMenuServer :: Dbusmenu.Server
|
||||
, sniGLibContext :: GLib.MainContext
|
||||
}
|
||||
@@ -73,3 +74,5 @@
|
||||
appState <- buildInitialState kanshiConn
|
||||
connVar <- newMVar kanshiConn
|
||||
stateVar <- newMVar appState
|
||||
+ initialRoot <- Dbusmenu.menuitemNew
|
||||
+ rootVar <- newMVar initialRoot
|
||||
@@ -76 +79 @@
|
||||
- let sniState = SNIState connVar stateVar menuServer context
|
||||
+ let sniState = SNIState connVar stateVar rootVar menuServer context
|
||||
@@ -168,6 +171,7 @@
|
||||
, onToggleMonitor = handleToggleMonitor sniState
|
||||
}
|
||||
newRoot <- buildMenu state actions
|
||||
+ modifyMVar_ (sniMenuRoot sniState) $ const (pure newRoot)
|
||||
runOnGLibMain (sniGLibContext sniState) $
|
||||
Dbusmenu.serverSetRoot (sniMenuServer sniState) newRoot
|
||||
Reference in New Issue
Block a user