Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed restoring app position for multiscreen #7353

Merged
merged 1 commit into from
Mar 23, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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