Maximized frameless window bug with enabled high dpi
-
Hi,
I use Qt 5.6 on Windows 10.
I have a problem with frameless window with enabled high dpi.
Simple project to reproduce the problem:
test project
Way to reproduce:- Maximize
- Hide
- Change to a lower resolution in system preferences
- Change resolution back
- Click on tray icon
After these steps, the window takes up much more space than is available on the screen.
How can I prevent this? -
-
I would replace
void MainWindow::maximizeWindow() { window()->setWindowState(Qt::WindowMaximized); window()->setGeometry(qApp->primaryScreen()->availableGeometry()); // This line is weird, see http://doc.qt.io/qt-5/application-windows.html#window-geometry }
with
void MainWindow::maximizeWindow() { window()->showMaximized(); }
-
Hi
Super with runable test project.
I tried the same a few times.
Maximize
Hide
Flipflop resolution ( say yes to keep it)
Then press the tray iconIn all cases, the "4" was still visible and it appears to have correct size.
I am using Qt 5.7
-
@nestorac
Welcome on board then :)
Yes something must be different if he sees the bug and i cant get it.
Also he has Qt5.6 and i have Qt5.7But it sounds like he click on tray icon and as far as i know, this restore the
window to whatever screen it is/was on.Did u try test project, its just works so very easy to test.
( you can download as zip if do not use GIT) -
I get:
make
main.cpp:6:32: error: 'AA_EnableHighDpiScaling' is not a member of 'Qt' QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); ^ main.cpp:7:32: error: 'AA_UseHighDpiPixmaps' is not a member of 'Qt' QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
-
Super
thank you for testing also.
I will see if I can get a 5.6 on win 10 to test with.
Not sure its a bug yet :) -
-