mirror of
https://github.com/encounter/SDL.git
synced 2025-12-21 10:49:12 +00:00
video: Refresh Windows display list on WM_DISPLAYCHANGE
- Displays may have been added, removed or changed and all cached monitor handles are invalidated as a result. - Display events are handled in three steps: 1. Mark all currently know displays as invalid 2. Enumerate all displays, adding new ones and marking known displays as valid 3. Remove all displays still invalid after enumeration - Display connect/disconnect events are sent when displays are added or removed after initial setup
This commit is contained in:
@@ -1057,6 +1057,13 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
||||
}
|
||||
break;
|
||||
|
||||
case WM_DISPLAYCHANGE:
|
||||
{
|
||||
// Reacquire displays if any were added or removed
|
||||
WIN_RefreshDisplays(SDL_GetVideoDevice());
|
||||
}
|
||||
break;
|
||||
|
||||
case WM_NCCALCSIZE:
|
||||
{
|
||||
Uint32 window_flags = SDL_GetWindowFlags(data->window);
|
||||
|
||||
Reference in New Issue
Block a user