Browse Source

windows: If a display's friendly name is blank, try the generic name.

Fixes #6031.
Ryan C. Gordon 3 năm trước cách đây
mục cha
commit
c6c0a8394e
1 tập tin đã thay đổi với 6 bổ sung0 xóa
  1. 6 0
      src/video/windows/SDL_windowsmodes.c

+ 6 - 0
src/video/windows/SDL_windowsmodes.c

@@ -271,6 +271,12 @@ WIN_GetDisplayNameVista(const WCHAR *deviceName)
             rc = pDisplayConfigGetDeviceInfo(&targetName.header);
             if (rc == ERROR_SUCCESS) {
                 retval = WIN_StringToUTF8W(targetName.monitorFriendlyDeviceName);
+                /* if we got an empty string, treat it as failure so we'll fallback
+                   to getting the generic name. */
+                if (retval && (*retval == '\0')) {
+                    SDL_free(retval);
+                    retval = NULL;
+                }
             }
             break;
         }