mirror of
https://github.com/bsnes-emu/bsnes.git
synced 2026-10-12 02:11:42 +00:00
Some of the work I'd done was duplicating existing work. Let's unify to get the best of both works. This mostly comes from: https://github.com/ares-emulator/ares/commit/ffe97222a1aabd325c301e07ba40042ea58ff081 Co-authored-by: Stefan Schlosser <[email protected]>
36 lines
819 B
C++
36 lines
819 B
C++
#if defined(Hiro_Monitor)
|
|
|
|
namespace hiro {
|
|
|
|
auto pMonitor::count() -> uint {
|
|
return QApplication::screens().count();
|
|
}
|
|
|
|
auto pMonitor::dpi(uint monitor) -> Position {
|
|
return {
|
|
QApplication::screens().at(monitor)->logicalDotsPerInchX(),
|
|
QApplication::screens().at(monitor)->logicalDotsPerInchY()
|
|
};
|
|
}
|
|
|
|
auto pMonitor::geometry(uint monitor) -> Geometry {
|
|
QRect rectangle = QApplication::screens()[monitor]->geometry();
|
|
return {rectangle.x(), rectangle.y(), rectangle.width(), rectangle.height()};
|
|
}
|
|
|
|
auto pMonitor::primary() -> uint {
|
|
return max(QApplication::screens().indexOf(QApplication::primaryScreen()), 0);
|
|
}
|
|
|
|
auto pMonitor::workspace(uint monitor) -> Geometry {
|
|
if(Monitor::count() == 1) {
|
|
return Desktop::workspace();
|
|
} else {
|
|
return Monitor::geometry(monitor);
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|