Skip to content

fix: restore bar if tray saving enabled#136

Open
wongma7 wants to merge 1 commit into
hyprwm:mainfrom
wongma7:traydestroy
Open

fix: restore bar if tray saving enabled#136
wongma7 wants to merge 1 commit into
hyprwm:mainfrom
wongma7:traydestroy

Conversation

@wongma7
Copy link
Copy Markdown

@wongma7 wongma7 commented Mar 5, 2026

Events::eventMapWindow is mistakenly telling the event loop to ignore a map request for the bar, the fix is to not ignore it, then the bar gets restored if tray saving is enabled and the config reloaded.

(Most of this PR consists of logging changes to make debugging & demonstrating the issue easier, the actual fix is in Events::eventMapWindow.)

Details:

After reload, the bar is destroyed then created. If the bar has a tray window child when we create it, i.e. when we call xcb_map_window in CStatusBar::setup, then it will result in recursive map call on the tray window child followed by some other xcb events and finally the expected map call on the bar. All these events have the same sequence/COOKIE even though they originate from one unique request. So when the first map call on the tray window child is received by Events::eventMapWindow and added to ignoredEvents, subsequent events are ignored including the expected map call on the bar, meaning the map call on the bar is never honored and it remains invisible.

Sample log with sequence=1143:

[LOG] Bar mapping!
[LOG] Fixing tray client on create 12582919 by reparenting to tray 8388613
[LOG] Will ignore map request event sequence 1143 on window 12582919

^ Events::eventMapWindow tells the event loop to ignore all subsequent events with sequence 1143

[LOG] Skipping: window attributes null
[LOG] window shouldn't be managed
[LOG] main: Event dispatched MAP
[LOG] main: Ignoring event type XCB_UNMAP_NOTIFY sequence 1143
[LOG] main: Ignoring event type XCB_DESTROY_NOTIFY sequence 1143
[LOG] main: Ignoring event type XCB_CREATE_NOTIFY sequence 1143
[LOG] main: Ignoring event type XCB_MAP_REQUEST sequence 1143

^ The bar XCB_MAP_REQUEST is sadly ignored

I believe the original intention of the ignore was to avoid recursive map requests so I tried to preserve that hence the changes to ignoredEvents type but I don't think it really matters.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant