فهرست منبع

UI: Remove now unused GetMonitorName for Qt < 6.4

derrod 1 سال پیش
والد
کامیت
8758ece291
3فایلهای تغییر یافته به همراه1 افزوده شده و 74 حذف شده
  1. 0 64
      UI/platform-windows.cpp
  2. 0 3
      UI/platform.hpp
  3. 1 7
      UI/window-basic-main.cpp

+ 0 - 64
UI/platform-windows.cpp

@@ -356,70 +356,6 @@ static BOOL CALLBACK GetMonitorCallback(HMONITOR monitor, HDC, LPRECT,
 	return true;
 }
 
-#if QT_VERSION < QT_VERSION_CHECK(6, 4, 0)
-#define GENERIC_MONITOR_NAME QStringLiteral("Generic PnP Monitor")
-
-QString GetMonitorName(const QString &id)
-{
-	MonitorData data = {};
-	data.id = (const wchar_t *)id.utf16();
-	data.info.cbSize = sizeof(data.info);
-
-	EnumDisplayMonitors(nullptr, nullptr, GetMonitorCallback,
-			    (LPARAM)&data);
-	if (!data.found) {
-		return GENERIC_MONITOR_NAME;
-	}
-
-	UINT32 numPath, numMode;
-	if (GetDisplayConfigBufferSizes(QDC_ONLY_ACTIVE_PATHS, &numPath,
-					&numMode) != ERROR_SUCCESS) {
-		return GENERIC_MONITOR_NAME;
-	}
-
-	std::vector<DISPLAYCONFIG_PATH_INFO> paths(numPath);
-	std::vector<DISPLAYCONFIG_MODE_INFO> modes(numMode);
-
-	if (QueryDisplayConfig(QDC_ONLY_ACTIVE_PATHS, &numPath, paths.data(),
-			       &numMode, modes.data(),
-			       nullptr) != ERROR_SUCCESS) {
-		return GENERIC_MONITOR_NAME;
-	}
-
-	DISPLAYCONFIG_TARGET_DEVICE_NAME target;
-	bool found = false;
-
-	paths.resize(numPath);
-	for (size_t i = 0; i < numPath; ++i) {
-		const DISPLAYCONFIG_PATH_INFO &path = paths[i];
-
-		DISPLAYCONFIG_SOURCE_DEVICE_NAME s;
-		s.header.type = DISPLAYCONFIG_DEVICE_INFO_GET_SOURCE_NAME;
-		s.header.size = sizeof(s);
-		s.header.adapterId = path.sourceInfo.adapterId;
-		s.header.id = path.sourceInfo.id;
-
-		if (DisplayConfigGetDeviceInfo(&s.header) == ERROR_SUCCESS &&
-		    wcscmp(data.info.szDevice, s.viewGdiDeviceName) == 0) {
-			target.header.type =
-				DISPLAYCONFIG_DEVICE_INFO_GET_TARGET_NAME;
-			target.header.size = sizeof(target);
-			target.header.adapterId = path.sourceInfo.adapterId;
-			target.header.id = path.targetInfo.id;
-			found = DisplayConfigGetDeviceInfo(&target.header) ==
-				ERROR_SUCCESS;
-			break;
-		}
-	}
-
-	if (!found) {
-		return GENERIC_MONITOR_NAME;
-	}
-
-	return QString::fromWCharArray(target.monitorFriendlyDeviceName);
-}
-#endif
-
 /* Based on https://www.winehq.org/pipermail/wine-devel/2008-September/069387.html */
 typedef const char *(CDECL *WINEGETVERSION)(void);
 bool IsRunningOnWine()

+ 0 - 3
UI/platform.hpp

@@ -76,9 +76,6 @@ public:
 	RunOnceMutex &operator=(RunOnceMutex &&rom);
 };
 
-#if QT_VERSION < QT_VERSION_CHECK(6, 4, 0)
-QString GetMonitorName(const QString &id);
-#endif
 bool IsRunningOnWine();
 #endif
 

+ 1 - 7
UI/window-basic-main.cpp

@@ -5606,13 +5606,7 @@ QList<QString> OBSBasic::GetProjectorMenuMonitorsFormatted()
 		QRect screenGeometry = screen->geometry();
 		qreal ratio = screen->devicePixelRatio();
 		QString name = "";
-#if defined(_WIN32) && QT_VERSION < QT_VERSION_CHECK(6, 4, 0)
-		QTextStream fullname(&name);
-		fullname << GetMonitorName(screen->name());
-		fullname << " (";
-		fullname << (i + 1);
-		fullname << ")";
-#elif defined(__APPLE__) || defined(_WIN32)
+#if defined(__APPLE__) || defined(_WIN32)
 		name = screen->name();
 #else
 		name = screen->model().simplified();