mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2024-11-14 13:27:41 -07: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:
parent
151610eb6c
commit
14c6bba21f
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user