Renamed SDL events for clarity

Fixes https://github.com/libsdl-org/SDL/issues/6877
This commit is contained in:
Sam Lantinga 2023-01-23 17:54:09 -08:00
parent 74697bc351
commit 7b50bae524
101 changed files with 1375 additions and 862 deletions

View file

@ -620,7 +620,7 @@ static void handle_configure_xdg_toplevel(void *data,
* No, we do not get minimize events from xdg-shell.
*/
SDL_SendWindowEvent(window,
maximized ? SDL_WINDOWEVENT_MAXIMIZED : SDL_WINDOWEVENT_RESTORED,
maximized ? SDL_EVENT_WINDOW_MAXIMIZED : SDL_EVENT_WINDOW_RESTORED,
0, 0);
/* Store current floating dimensions for restoring */
@ -670,7 +670,7 @@ static void handle_configure_xdg_toplevel(void *data,
static void handle_close_xdg_toplevel(void *data, struct xdg_toplevel *xdg_toplevel)
{
SDL_WindowData *window = (SDL_WindowData *)data;
SDL_SendWindowEvent(window->sdlwindow, SDL_WINDOWEVENT_CLOSE, 0, 0);
SDL_SendWindowEvent(window->sdlwindow, SDL_EVENT_WINDOW_CLOSE_REQUESTED, 0, 0);
}
static const struct xdg_toplevel_listener toplevel_listener_xdg = {
@ -691,7 +691,7 @@ static void handle_configure_xdg_popup(void *data,
static void handle_done_xdg_popup(void *data, struct xdg_popup *xdg_popup)
{
SDL_WindowData *window = (SDL_WindowData *)data;
SDL_SendWindowEvent(window->sdlwindow, SDL_WINDOWEVENT_CLOSE, 0, 0);
SDL_SendWindowEvent(window->sdlwindow, SDL_EVENT_WINDOW_CLOSE_REQUESTED, 0, 0);
}
static void handle_repositioned_xdg_popup(void *data,
@ -711,7 +711,7 @@ static const struct xdg_popup_listener popup_listener_xdg = {
static int Wayland_PopupWatch(void *data, SDL_Event *event)
{
if (event->type == SDL_MOUSEMOTION) {
if (event->type == SDL_EVENT_MOUSE_MOTION) {
SDL_Window *window = (SDL_Window *)data;
SDL_WindowData *wind = window->driverdata;
@ -849,13 +849,13 @@ static void decoration_frame_configure(struct libdecor_frame *frame,
* No, we do not get minimize events from libdecor.
*/
SDL_SendWindowEvent(window,
maximized ? SDL_WINDOWEVENT_MAXIMIZED : SDL_WINDOWEVENT_RESTORED,
maximized ? SDL_EVENT_WINDOW_MAXIMIZED : SDL_EVENT_WINDOW_RESTORED,
0, 0);
}
/* Similar to maximized/restore events above, send focus events too! */
SDL_SendWindowEvent(window,
focused ? SDL_WINDOWEVENT_FOCUS_GAINED : SDL_WINDOWEVENT_FOCUS_LOST,
focused ? SDL_EVENT_WINDOW_FOCUS_GAINED : SDL_EVENT_WINDOW_FOCUS_LOST,
0, 0);
/* For fullscreen or fixed-size windows we know our size.
@ -953,14 +953,14 @@ static void decoration_frame_configure(struct libdecor_frame *frame,
static void decoration_frame_close(struct libdecor_frame *frame, void *user_data)
{
SDL_SendWindowEvent(((SDL_WindowData *)user_data)->sdlwindow, SDL_WINDOWEVENT_CLOSE, 0, 0);
SDL_SendWindowEvent(((SDL_WindowData *)user_data)->sdlwindow, SDL_EVENT_WINDOW_CLOSE_REQUESTED, 0, 0);
}
static void decoration_frame_commit(struct libdecor_frame *frame, void *user_data)
{
SDL_WindowData *wind = user_data;
SDL_SendWindowEvent(wind->sdlwindow, SDL_WINDOWEVENT_EXPOSED, 0, 0);
SDL_SendWindowEvent(wind->sdlwindow, SDL_EVENT_WINDOW_EXPOSED, 0, 0);
}
static struct libdecor_frame_interface libdecor_frame_interface = {
@ -985,7 +985,7 @@ static void handle_set_generic_property(void *data,
static void handle_close(void *data, struct qt_extended_surface *qt_extended_surface)
{
SDL_WindowData *window = (SDL_WindowData *)data;
SDL_SendWindowEvent(window->sdlwindow, SDL_WINDOWEVENT_CLOSE, 0, 0);
SDL_SendWindowEvent(window->sdlwindow, SDL_EVENT_WINDOW_CLOSE_REQUESTED, 0, 0);
}
static const struct qt_extended_surface_listener extended_surface_listener = {
@ -1059,7 +1059,7 @@ static void Wayland_move_window(SDL_Window *window,
*/
SDL_Rect bounds;
SDL_GetDisplayBounds(i, &bounds);
SDL_SendWindowEvent(window, SDL_WINDOWEVENT_MOVED, bounds.x, bounds.y);
SDL_SendWindowEvent(window, SDL_EVENT_WINDOW_MOVED, bounds.x, bounds.y);
break;
}
}
@ -2053,7 +2053,7 @@ static void Wayland_HandleResize(SDL_Window *window, int width, int height, floa
* so we must override the deduplication logic in the video core */
window->w = 0;
window->h = 0;
SDL_SendWindowEvent(window, SDL_WINDOWEVENT_RESIZED, width, height);
SDL_SendWindowEvent(window, SDL_EVENT_WINDOW_RESIZED, width, height);
window->w = width;
window->h = height;
data->needs_resize_event = SDL_FALSE;