Always Use Next Display Index
WIN_AddDisplay asserted that the returned index is the expected next one in the list. This can be an unexpected number when displays are add and removed in a batch (eg, Remote Desktop disconnect and reconnect). Instead always just make use of the next index, even if it is not the expected next index value. This fixes issue #9105
This commit is contained in:
1 parent
11ffdd3abc
commit
bee8874629
1 file changed
+1
-2
@@ -377,11 +377,10 @@ static void WIN_AddDisplay(_THIS, HMONITOR hMonitor, const MONITORINFOEXW *info,
|
|||||||
display.driverdata = displaydata;
|
display.driverdata = displaydata;
|
||||||
WIN_GetDisplayBounds(_this, &display, &displaydata->bounds);
|
WIN_GetDisplayBounds(_this, &display, &displaydata->bounds);
|
||||||
index = SDL_AddVideoDisplay(&display, send_event);
|
index = SDL_AddVideoDisplay(&display, send_event);
|
||||||
SDL_assert(index == *display_index);
|
|
||||||
SDL_free(display.name);
|
SDL_free(display.name);
|
||||||
|
|
||||||
done:
|
done:
|
||||||
*display_index += 1;
|
*display_index = index + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef struct _WIN_AddDisplaysData
|
typedef struct _WIN_AddDisplaysData
|
||||||
|
|||||||
Reference in new issue
Block a user