From 6fd46d3c39eb98cd4df4a270c855ed864c518399 Mon Sep 17 00:00:00 2001 From: Serge Camille Date: Sun, 12 Feb 2023 15:25:21 +0100 Subject: [PATCH] Disable restoring UI position Restoring the ui to a previously stored place that is potentially not the primary monitor causes issues for some users. See https://github.com/simulationcraft/simc/issues/5047 Until we can figure out why this is happening and can be resolved, restoring the ui position is intentionally disabled --- qt/MainWindow.cpp | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/qt/MainWindow.cpp b/qt/MainWindow.cpp index 18a33844f28..5976ff4128b 100644 --- a/qt/MainWindow.cpp +++ b/qt/MainWindow.cpp @@ -101,18 +101,24 @@ void SC_MainWindow::loadHistory() tr( "We have reset your configuration settings due to major changes to the GUI" ) ); } - QVariant size = settings.value( "gui/size" ); - QRect savedApplicationGeometry = geometry(); - if ( size.isValid() ) + // Restoring the ui to a previously stored place that is potentially not the primary monitor causes issues for some users. See https://github.com/simulationcraft/simc/issues/5047 + // Until we can figure out why this is happening and can be resolved, restoring the ui position is intentionally disabled + if constexpr(false) { - savedApplicationGeometry.setSize( size.toSize() ); - } - QVariant pos = settings.value( "gui/position" ); - if ( pos.isValid() ) - { - savedApplicationGeometry.moveTopLeft( pos.toPoint() ); + QVariant size = settings.value( "gui/size" ); + QRect savedApplicationGeometry = geometry(); + if ( size.isValid() ) + { + savedApplicationGeometry.setSize( size.toSize() ); + } + QVariant pos = settings.value( "gui/position" ); + if ( pos.isValid() ) + { + savedApplicationGeometry.moveTopLeft( pos.toPoint() ); + } + setGeometry(savedApplicationGeometry); } - setGeometry(savedApplicationGeometry); + QVariant maximized = settings.value( "gui/maximized" ); if ( maximized.isValid() ) {