From 84a3a39e926b1a641c38f82dc5586dc646e04a9e Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Wed, 14 Feb 2018 12:05:05 +0100 Subject: opentrack: prevent buggy resize with hidpi This can be reproduced with hidpi, playing Falcon BMS in a resolution lower than the desktop resolution. The windows got resized to way more than as if they were maximized. This is a workaround, from the Qt API perspective it doesn't make sense. --- variant/default/main-window.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/variant/default/main-window.cpp b/variant/default/main-window.cpp index 47dce2c4..03e58af4 100644 --- a/variant/default/main-window.cpp +++ b/variant/default/main-window.cpp @@ -72,9 +72,6 @@ main_window::main_window() : annoy_if_root(); #endif - setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); - setWindowFlags(Qt::MSWindowsFixedSizeDialogHint | windowFlags()); - update_button_state(false, false); if (group::ini_directory().size() == 0) @@ -191,8 +188,9 @@ main_window::main_window() : config_list_timer.start(1000 * 5); kbd_quit.setEnabled(true); + setWindowFlags(Qt::MSWindowsFixedSizeDialogHint | windowFlags()); + setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); adjustSize(); - setFixedSize(size()); if (!start_in_tray()) { @@ -626,12 +624,10 @@ bool main_window::mk_window_common(std::unique_ptr& d, F&& ctor) QWidget& w = *d; w.setWindowFlags(Qt::MSWindowsFixedSizeDialogHint | w.windowFlags()); - w.setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); w.show(); w.adjustSize(); - w.setFixedSize(w.size()); return true; } -- cgit v1.2.3