Repository navigation
fix: keep title bar and system button state consistent across changes - #270
Open
SineStriker wants to merge 4 commits into
Open
SineStriker wants to merge 4 commits into
SineStriker wants to merge 4 commits into
Conversation
This branch has not been deployed
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.
Motivation
setTitleBar()documents that the system buttons and hit-test visible items are unset when the title bar changes. The implementation performed this only when the previous title bar still existed, so a first assignment kept the earlier state. The title bar is aQPointer, so destroying it also left its system buttons set on the agent.setTitleBar()also asserted a non-null item, which madenullptrunusable as "no title bar".This PR is a follow-up to the review of #262.
Behavior
setTitleBar(nullptr)removes the title bar.systemButtonChanged(role, nullptr)for each cleared system button, and emitstitleBarChanged(nullptr)(Widgets) ortitleBarWidgetChanged(nullptr)(Quick).systemButtonChanged(role, nullptr)for each cleared system button. Destroying a title bar that has already been replaced emits nothing.WindowAgentBasePrivate. Each agent emits its typed signals and performs its macOS updates in the notification functions.setHitTestVisible()does not emit a signal. This is unchanged.setTitleBar(),setSystemButton(), andsetHitTestVisible()is added forQuickWindowAgent, and the qdoc of the Widgets functions states the unset behavior and the ordering constraints.Notes for reviewers
WindowAgentBasePrivateis an installed private header. It gains pure virtual functionsnotifyTitleBarReplaced()andnotifyTitleBarDestroyed(), so the class is abstract. The only subclasses in this repository areWidgetWindowAgentPrivateandQuickWindowAgentPrivate.Verification
Not verified: Windows and Linux. The implementations for these platforms are not compiled on the test machine.