diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2018-02-14 12:05:05 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2018-02-14 12:05:05 +0100 |
commit | 84a3a39e926b1a641c38f82dc5586dc646e04a9e (patch) | |
tree | 54d654decd2205834635ea7925e8d06f6131ef39 /variant/default | |
parent | 147a9fa78286a1a5c09951777e61fa4251568746 (diff) |
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.
Diffstat (limited to 'variant/default')
-rw-r--r-- | variant/default/main-window.cpp | 8 |
1 files 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<t>& 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; } |