File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,3 +4,4 @@ export const launcherVisible = Variable(false);
44export const powerMenuVisible = Variable ( false ) ;
55export const barVisible = Variable ( true ) ;
66export const barAutohide = Variable ( false ) ;
7+ export const trayMenuOpen = Variable ( false ) ;
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ import Wp from 'gi://AstalWp';
66import Tray from 'gi://AstalTray' ;
77import Pango from 'gi://Pango' ;
88import AstalBattery from 'gi://AstalBattery' ;
9- import { barVisible , barAutohide } from '../lib/state' ;
9+ import { barVisible , barAutohide , trayMenuOpen } from '../lib/state' ;
1010
1111type WMState = {
1212 activeWs : Variable < number > ;
@@ -346,6 +346,13 @@ function SysTray() {
346346 const menu = Gtk . Menu . new_from_model ( item . menuModel ) ;
347347 menu . insert_action_group ( 'dbusmenu' , item . actionGroup ) ;
348348 menu . get_style_context ( ) . add_class ( 'tray-menu' ) ;
349+ trayMenuOpen . set ( true ) ;
350+ menu . connect ( 'deactivate' , ( ) => {
351+ trayMenuOpen . set ( false ) ;
352+ if ( barAutohide . get ( ) ) {
353+ barVisible . set ( false ) ;
354+ }
355+ } ) ;
349356 menu . popup_at_widget (
350357 self ,
351358 Gdk . Gravity . SOUTH ,
@@ -428,7 +435,7 @@ export default function Bar(monitor: number) {
428435 >
429436 < eventbox
430437 onHoverLost = { ( ) => {
431- if ( barAutohide . get ( ) ) {
438+ if ( barAutohide . get ( ) && ! trayMenuOpen . get ( ) ) {
432439 barVisible . set ( false ) ;
433440 }
434441 } }
You can’t perform that action at this time.
0 commit comments