mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-06-07 07:00:48 +00:00
Fixed display hotplug events
The add event was accidentally removed in 30e176d6ba
This commit is contained in:
parent
753f3f8609
commit
6d64d821fb
1 changed files with 5 additions and 1 deletions
|
|
@ -759,7 +759,7 @@ SDL_DisplayID SDL_AddVideoDisplay(const SDL_VideoDisplay *display, SDL_bool send
|
|||
_this->displays[_this->num_displays++] = new_display;
|
||||
|
||||
id = SDL_GetNextObjectID();
|
||||
SDL_memcpy(new_display, display, sizeof(*new_display));
|
||||
SDL_copyp(new_display, display);
|
||||
new_display->id = id;
|
||||
new_display->device = _this;
|
||||
if (display->name) {
|
||||
|
|
@ -790,6 +790,10 @@ SDL_DisplayID SDL_AddVideoDisplay(const SDL_VideoDisplay *display, SDL_bool send
|
|||
|
||||
SDL_UpdateDesktopBounds();
|
||||
|
||||
if (send_event) {
|
||||
SDL_SendDisplayEvent(new_display, SDL_EVENT_DISPLAY_ADDED, 0);
|
||||
}
|
||||
|
||||
return id;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue