mirror of
https://github.com/obsproject/obs-studio.git
synced 2024-09-20 13:08:50 +02:00
UI: Fix monitor name for projectors on Windows
From Qt 6.4 release notes: QScreen::name() now returns the user friendly name instead of the GDI device name on Windows. This is consistent with other platforms and also obeys the documentation. -- Additionally, this scraps the visual indexing on monitors as the numbering is not guaranteed to match any other GUI or API. A similar change was recently made in the Display Capture source on Windows.
This commit is contained in:
parent
dd61943ddf
commit
d27cda1fa2
@ -5061,13 +5061,13 @@ void OBSBasic::AddProjectorMenuMonitors(QMenu *parent, QObject *target,
|
|||||||
QRect screenGeometry = screen->geometry();
|
QRect screenGeometry = screen->geometry();
|
||||||
qreal ratio = screen->devicePixelRatio();
|
qreal ratio = screen->devicePixelRatio();
|
||||||
QString name = "";
|
QString name = "";
|
||||||
#ifdef _WIN32
|
#if defined(_WIN32) && QT_VERSION < QT_VERSION_CHECK(6, 4, 0)
|
||||||
QTextStream fullname(&name);
|
QTextStream fullname(&name);
|
||||||
fullname << GetMonitorName(screen->name());
|
fullname << GetMonitorName(screen->name());
|
||||||
fullname << " (";
|
fullname << " (";
|
||||||
fullname << (i + 1);
|
fullname << (i + 1);
|
||||||
fullname << ")";
|
fullname << ")";
|
||||||
#elif defined(__APPLE__)
|
#elif defined(__APPLE__) || defined(_WIN32)
|
||||||
name = screen->name();
|
name = screen->name();
|
||||||
#else
|
#else
|
||||||
name = screen->model().simplified();
|
name = screen->model().simplified();
|
||||||
|
Loading…
Reference in New Issue
Block a user