Closed baraclese closed 3 years ago
And I would be extremely grateful to you, any help is welcome. However, it's strange, I also have a multi monitor setup and cannot reproduce the problem.
https://github.com/punesemu/puNES/commit/f403d558d952b9817610b4b86a1f413484ec71c2. Thx for the patch, I owe you a :beer: .
When the application starts https://github.com/punesemu/puNES/blob/c9c4e1ef0b4328239fb9d5e7977759cd9fe46a6c/src/gui/qt.cpp#L142n returns -1, so it throws an out of index exception on the next line. Not sure why it returns -1. Anyway one could do
QRect geometry = QGuiApplication::primaryScreen()->virtualGeometry();
to get the geometry of all monitors combined. But then there are problems because cfg->last_pos does not know about which monitor it refers to so the app window will always restore on one monitor only.Maybe punes should let QT store window position and size via QSettings and that will handle the multimonitor stuff automatically. I would be willing to write a patch for that.