Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: avoid promoting child widgets to child windows #5161

Merged
merged 5 commits into from Feb 10, 2024

Conversation

Nerixyz
Copy link
Contributor

@Nerixyz Nerixyz commented Feb 6, 2024

The issue this fixes is at least similar to #5006, but since there aren't any reproduction steps, I don't know for sure if it's the same.

I could reproduce the issue by enabling the Always on top setting, restarting Chatterino and then opening the settings. Afterward, the main window was immovable.

The underlying issue with winId:

Even though QWidget::winId() is const, it can create windows. In our case, it can promote child widgets to native windows. Visually, there's no change, but these child windows all handle events on their own and on Windows, the parent only gets info about this through WM_PARENTNOTIFY - thus the non-client events aren't sent, and the window appears to be immovable.

To prevent this, we set AA_DontCreateNativeWidgetSiblings. Additionally, we check if the window has been created yet when getting the window-id, if we don't know the HWND from some native message, as calling the function will create a window-id if none has been created yet. For the isTopMost setting, we wait until the window has a window-id and apply the setting there.

I'm inclined to say #4994 didn't cause this (hence, I don't know for sure if it fixes the mentioned issue).

@pajlada pajlada enabled auto-merge (squash) February 10, 2024 10:57
@pajlada pajlada merged commit 10aabd3 into Chatterino:master Feb 10, 2024
20 checks passed
@Nerixyz Nerixyz deleted the fix/premature-winid branch February 10, 2024 11:44
devJimmyboy pushed a commit to devJimmyboy/chatterino7 that referenced this pull request Feb 11, 2024
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.

None yet

2 participants