fix: restore bar if tray saving enabled#136
Open
wongma7 wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
^ Events::eventMapWindow tells the event loop to ignore all subsequent events with 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.