Skip to content

Commit

Permalink
Fixed restoring app position for multiscreen (#7353)
Browse files Browse the repository at this point in the history
  • Loading branch information
Reksotiv authored Mar 23, 2023
1 parent 59f15fa commit 1ccd887
Showing 1 changed file with 2 additions and 20 deletions.
22 changes: 2 additions & 20 deletions qt/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,24 +101,7 @@ void SC_MainWindow::loadHistory()
tr( "We have reset your configuration settings due to major changes to the GUI" ) );
}

// 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)
{
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);
}

restoreGeometry( settings.value( "gui/geometry" ).toByteArray() );
QVariant maximized = settings.value( "gui/maximized" );
if ( maximized.isValid() )
{
Expand Down Expand Up @@ -181,8 +164,7 @@ void SC_MainWindow::saveHistory()
QSettings settings;
settings.beginGroup( "gui" );
settings.setValue( "gui_version_number", SC_GUI_HISTORY_VERSION );
settings.setValue( "size", normalGeometry().size() );
settings.setValue( "position", normalGeometry().topLeft() );
settings.setValue( "geometry", saveGeometry() );
settings.setValue( "maximized", bool( windowState() & Qt::WindowMaximized ) );
settings.endGroup();

Expand Down

0 comments on commit 1ccd887

Please sign in to comment.