mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2025-06-28 01:49:42 -06:00
Manually center the window after setting its size on macOS
Qt's default window positioning is somewhat unreliable, and since we don't currently remember the window position, let's at least make sure that it's properly centered on open.
This commit is contained in:
@ -1566,6 +1566,13 @@ MainWindow::MainWindow(QWidget* parent) : QMainWindow(parent)
|
||||
|
||||
resize(Config::WindowWidth, Config::WindowHeight);
|
||||
|
||||
#ifdef Q_OS_MAC
|
||||
QPoint screenCenter = screen()->availableGeometry().center();
|
||||
QRect frameGeo = frameGeometry();
|
||||
frameGeo.moveCenter(screenCenter);
|
||||
move(frameGeo.topLeft());
|
||||
#endif
|
||||
|
||||
if (oldMax)
|
||||
showMaximized();
|
||||
else
|
||||
|
Reference in New Issue
Block a user