-
Notifications
You must be signed in to change notification settings - Fork 171
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
Restore layout for window doesn't work if it's currently maximized #477
Comments
You might be right, but I would like to reproduce this as well, to maybe write a test. Can't repro on Win11 / Qt 6.6.2, stock Which versions are you on ? |
Sure, my code above should just be a hint where / what the problems are... |
Thanks, reproduced with Qt 5 |
We'll be having some tests that we want to run in the real window manager, not offscreen. For issue #477
Tests maximize vs restore in the real QPA, not offscreen. For issue #477.
By black listing all failing platforms. We'll be fixing one by one. For issue #477
Tested on Linux/KDE and offscreen platforms. Will whitelist the others as soon as tested there as well. Patch suggested by bbc131 in issue #477
Works for me now, thanks for the investigation |
I think there is a regression. |
Works on Windows/QtWidgets Fails on Windows/QtQuick. Will test other platforms as well. For issue #477
We need to set geometry before maximizing, otherwise it doesn't get set as "normal geometry". However, when going from maximized to normal, we need to set state first. If CI stays green then it means issue #477 can be closed.
I've added tests for that case as well now, and fixed it. Windows and KDE pass the test. |
Tests are passing on mac and ubuntu now |
The problem can be reproduced with the example
qtwidgets_dockwidgets
:Now, on Windows, the mainwindow looks like correctly restored but isn't.
For example, you cannot change its size by click'n'drag on its edges, you first need to move it a bit by click'n'drag at the windows title bar.
(On Ubuntu, the restoring also doesn't work, but behaves differently. The window just stays maximized.)
To fix this, I think there are two things in
LayoutSaver::restoreLayout(..)
, that need to be changed.WindowState::None
.deserializeWindowGeometry
cannot set the geometry correctly, if the window is currently maximized, so the window-state should be changed beforehand.I checked this by playing a bit and this hack seems to solve the problem:
The text was updated successfully, but these errors were encountered: