Skip to content

Commit e80d084

Browse files
slime73slouken
authored andcommitted
expose events originating from a live-resize set the data1 field to 1.
Fixes #13243.
1 parent 6aedc48 commit e80d084

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

include/SDL3/SDL_events.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,8 @@ typedef enum SDL_EventType
135135
/* 0x201 was SDL_SYSWMEVENT, reserve the number for sdl2-compat */
136136
SDL_EVENT_WINDOW_SHOWN = 0x202, /**< Window has been shown */
137137
SDL_EVENT_WINDOW_HIDDEN, /**< Window has been hidden */
138-
SDL_EVENT_WINDOW_EXPOSED, /**< Window has been exposed and should be redrawn, and can be redrawn directly from event watchers for this event */
138+
SDL_EVENT_WINDOW_EXPOSED, /**< Window has been exposed and should be redrawn, and can be redrawn directly from event watchers for this event.
139+
data1 is 1 for live-resize expose events, 0 otherwise. */
139140
SDL_EVENT_WINDOW_MOVED, /**< Window has been moved to data1, data2 */
140141
SDL_EVENT_WINDOW_RESIZED, /**< Window has been resized to data1xdata2 */
141142
SDL_EVENT_WINDOW_PIXEL_SIZE_CHANGED,/**< The pixel size of the window has changed to data1xdata2 */

src/video/SDL_video.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4139,7 +4139,7 @@ void SDL_OnWindowLiveResizeUpdate(SDL_Window *window)
41394139
SDL_IterateMainCallbacks(false);
41404140
} else {
41414141
// Send an expose event so the application can redraw
4142-
SDL_SendWindowEvent(window, SDL_EVENT_WINDOW_EXPOSED, 0, 0);
4142+
SDL_SendWindowEvent(window, SDL_EVENT_WINDOW_EXPOSED, 1, 0);
41434143
}
41444144

41454145
SDL_PumpEventMaintenance();

0 commit comments

Comments
 (0)