mirror of
https://github.com/obsproject/obs-studio.git
synced 2024-07-19 17:49:14 +00:00
UI: Make projector display resolutions DPI-aware
Follow up to PR #3988 and commit
5cdd084c7f
.
Without this change, displays listed as projector targets on systems
using a fractional scaling factor (e.g., 125%, 150%, 175%) will show an
incorrect width and height for their size. For a display with 125%
scaling, OBS would show 1536x864 instead of 1920x1080. With this change,
it will show 1920x1080.
This commit is contained in:
parent
4002995b86
commit
b496f43d45
|
@ -4718,6 +4718,7 @@ void OBSBasic::AddProjectorMenuMonitors(QMenu *parent, QObject *target,
|
|||
for (int i = 0; i < screens.size(); i++) {
|
||||
QScreen *screen = screens[i];
|
||||
QRect screenGeometry = screen->geometry();
|
||||
qreal ratio = screen->devicePixelRatio();
|
||||
QString name = "";
|
||||
#ifdef _WIN32
|
||||
QTextStream fullname(&name);
|
||||
|
@ -4743,8 +4744,10 @@ void OBSBasic::AddProjectorMenuMonitors(QMenu *parent, QObject *target,
|
|||
QString str =
|
||||
QString("%1: %2x%3 @ %4,%5")
|
||||
.arg(name,
|
||||
QString::number(screenGeometry.width()),
|
||||
QString::number(screenGeometry.height()),
|
||||
QString::number(screenGeometry.width() *
|
||||
ratio),
|
||||
QString::number(screenGeometry.height() *
|
||||
ratio),
|
||||
QString::number(screenGeometry.x()),
|
||||
QString::number(screenGeometry.y()));
|
||||
|
||||
|
|
Loading…
Reference in a new issue