diff --git a/src/events/SDL_mouse.c b/src/events/SDL_mouse.c index 93337de768f35..f2782744ae7b0 100644 --- a/src/events/SDL_mouse.c +++ b/src/events/SDL_mouse.c @@ -236,24 +236,14 @@ static Uint32 GetButtonState(SDL_Mouse *mouse, SDL_bool include_touch) return buttonstate; } -SDL_Window * -SDL_GetMouseFocus(void) +SDL_Window *SDL_GetMouseFocus(void) { SDL_Mouse *mouse = SDL_GetMouse(); return mouse->focus; } -/* TODO RECONNECT: Hello from the Wayland video driver! - * This was once removed from SDL, but it's been added back in comment form - * because we will need it when Wayland adds compositor reconnect support. - * If you need this before we do, great! Otherwise, leave this alone, we'll - * uncomment it at the right time. - * -flibit - */ -#if 0 -void -SDL_ResetMouse(void) +void SDL_ResetMouse(void) { SDL_Mouse *mouse = SDL_GetMouse(); Uint32 buttonState = GetButtonState(mouse, SDL_FALSE); @@ -266,7 +256,6 @@ SDL_ResetMouse(void) } SDL_assert(GetButtonState(mouse, SDL_FALSE) == 0); } -#endif /* 0 */ void SDL_SetMouseFocus(SDL_Window *window) { diff --git a/src/events/SDL_mouse_c.h b/src/events/SDL_mouse_c.h index 045ef0b302002..6e16e9a503427 100644 --- a/src/events/SDL_mouse_c.h +++ b/src/events/SDL_mouse_c.h @@ -159,10 +159,8 @@ extern int SDL_SendMouseWheel(Uint64 timestamp, SDL_Window *window, SDL_MouseID /* Warp the mouse within the window, potentially overriding relative mode */ extern void SDL_PerformWarpMouseInWindow(SDL_Window *window, int x, int y, SDL_bool ignore_relative_mode); -/* TODO RECONNECT: Set mouse state to "zero" */ -#if 0 +/* Set mouse state to "zero" */ extern void SDL_ResetMouse(void); -#endif /* 0 */ /* Shutdown the mouse subsystem */ extern void SDL_MouseQuit(void); diff --git a/src/video/wayland/SDL_waylandmouse.c b/src/video/wayland/SDL_waylandmouse.c index 51233847348e8..b726ea3c8980f 100644 --- a/src/video/wayland/SDL_waylandmouse.c +++ b/src/video/wayland/SDL_waylandmouse.c @@ -577,7 +577,6 @@ static void SDLCALL Wayland_EmulateMouseWarpChanged(void *userdata, const char * input->warp_emulation_prohibited = !SDL_GetStringBoolean(hint, !input->warp_emulation_prohibited); } -#if 0 /* TODO RECONNECT: See waylandvideo.c for more information! */ static void Wayland_RecreateCursor(SDL_Cursor *cursor, SDL_VideoData *vdata) { Wayland_CursorData *cdata = (Wayland_CursorData *) cursor->driverdata; @@ -602,8 +601,7 @@ static void Wayland_RecreateCursor(SDL_Cursor *cursor, SDL_VideoData *vdata) wl_surface_set_user_data(cdata->surface, NULL); } -void -Wayland_RecreateCursors(void) +void Wayland_RecreateCursors(void) { SDL_Cursor *cursor; SDL_Mouse *mouse = SDL_GetMouse(); @@ -632,7 +630,6 @@ Wayland_RecreateCursors(void) } } } -#endif /* 0 */ void Wayland_InitMouse(void) { diff --git a/src/video/wayland/SDL_waylandmouse.h b/src/video/wayland/SDL_waylandmouse.h index 4befa7839da12..1ef2b2c157b16 100644 --- a/src/video/wayland/SDL_waylandmouse.h +++ b/src/video/wayland/SDL_waylandmouse.h @@ -26,8 +26,6 @@ extern void Wayland_InitMouse(void); extern void Wayland_FiniMouse(SDL_VideoData *data); -#if 0 /* TODO RECONNECT: See waylandvideo.c for more information! */ extern void Wayland_RecreateCursors(void); -#endif /* 0 */ #endif diff --git a/src/video/wayland/SDL_waylandsym.h b/src/video/wayland/SDL_waylandsym.h index 4ff726e99ba6d..8a57ff5607967 100644 --- a/src/video/wayland/SDL_waylandsym.h +++ b/src/video/wayland/SDL_waylandsym.h @@ -86,11 +86,8 @@ SDL_WAYLAND_SYM(struct wl_proxy*, wl_proxy_marshal_flags, (struct wl_proxy *prox SDL_WAYLAND_SYM(struct wl_proxy*, wl_proxy_marshal_array_flags, (struct wl_proxy *proxy, uint32_t opcode, const struct wl_interface *interface, uint32_t version, uint32_t flags, union wl_argument *args)) #endif -#if 0 /* TODO RECONNECT: See waylandvideo.c for more information! */ -#if SDL_WAYLAND_CHECK_VERSION(broken, on, purpose) -SDL_WAYLAND_SYM(int, wl_display_reconnect, (struct wl_display*)); -#endif -#endif /* 0 */ +SDL_WAYLAND_MODULE(WAYLAND_CLIENT_1_SOON) +SDL_WAYLAND_SYM(int, wl_display_reconnect, (struct wl_display*)) SDL_WAYLAND_INTERFACE(wl_seat_interface) SDL_WAYLAND_INTERFACE(wl_surface_interface) diff --git a/src/video/wayland/SDL_waylandvideo.c b/src/video/wayland/SDL_waylandvideo.c index 870a7f17f5b98..df7182d5f22f1 100644 --- a/src/video/wayland/SDL_waylandvideo.c +++ b/src/video/wayland/SDL_waylandvideo.c @@ -1123,7 +1123,6 @@ static void Wayland_VideoCleanup(_THIS) SDL_bool Wayland_VideoReconnect(_THIS) { -#if 0 /* TODO RECONNECT: Uncomment all when https://invent.kde.org/plasma/kwin/-/wikis/Restarting is completed */ SDL_VideoData *data = _this->driverdata; SDL_Window *window = NULL; @@ -1136,7 +1135,7 @@ SDL_bool Wayland_VideoReconnect(_THIS) SDL_ResetKeyboard(); SDL_ResetMouse(); - if (WAYLAND_wl_display_reconnect(data->display) < 0) { + if (!SDL_WAYLAND_HAVE_WAYLAND_CLIENT_1_SOON || WAYLAND_wl_display_reconnect(data->display) < 0) { return SDL_FALSE; } @@ -1163,9 +1162,6 @@ SDL_bool Wayland_VideoReconnect(_THIS) SDL_GL_MakeCurrent (current_window, current_ctx); } return SDL_TRUE; -#else - return SDL_FALSE; -#endif /* 0 */ } void Wayland_VideoQuit(_THIS)