mirror of
				https://github.com/libsdl-org/SDL.git
				synced 2025-10-26 12:27:44 +00:00 
			
		
		
		
	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
(cherry picked from commit bee8874629)
			
			
This commit is contained in:
		| @@ -355,11 +355,10 @@ static void WIN_AddDisplay(_THIS, HMONITOR hMonitor, const MONITORINFOEXW *info, | ||||
|     display.driverdata = displaydata; | ||||
|     WIN_GetDisplayBounds(_this, &display, &displaydata->bounds); | ||||
|     index = SDL_AddVideoDisplay(&display, send_event); | ||||
|     SDL_assert(index == *display_index); | ||||
|     SDL_free(display.name); | ||||
|  | ||||
| done: | ||||
|     *display_index += 1; | ||||
|     *display_index = index + 1; | ||||
| } | ||||
|  | ||||
| typedef struct _WIN_AddDisplaysData | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 jimtahu
					jimtahu