Skip to content

Commit de76e80

Browse files
committed
wayland: Uncomment support for wl_display_reconnect
1 parent 389ffab commit de76e80

File tree

6 files changed

+4
-26
lines changed

6 files changed

+4
-26
lines changed

src/events/SDL_mouse.c

-9
Original file line numberDiff line numberDiff line change
@@ -266,14 +266,6 @@ SDL_GetMouseFocus(void)
266266
return mouse->focus;
267267
}
268268

269-
/* TODO RECONNECT: Hello from the Wayland video driver!
270-
* This was once removed from SDL, but it's been added back in comment form
271-
* because we will need it when Wayland adds compositor reconnect support.
272-
* If you need this before we do, great! Otherwise, leave this alone, we'll
273-
* uncomment it at the right time.
274-
* -flibit
275-
*/
276-
#if 0
277269
void
278270
SDL_ResetMouse(void)
279271
{
@@ -288,7 +280,6 @@ SDL_ResetMouse(void)
288280
}
289281
SDL_assert(GetButtonState(mouse, SDL_FALSE) == 0);
290282
}
291-
#endif /* 0 */
292283

293284
void
294285
SDL_SetMouseFocus(SDL_Window * window)

src/events/SDL_mouse_c.h

+1-3
Original file line numberDiff line numberDiff line change
@@ -164,10 +164,8 @@ extern int SDL_SendMouseWheel(SDL_Window * window, SDL_MouseID mouseID, float x,
164164
/* Warp the mouse within the window, potentially overriding relative mode */
165165
extern void SDL_PerformWarpMouseInWindow(SDL_Window *window, int x, int y, SDL_bool ignore_relative_mode);
166166

167-
/* TODO RECONNECT: Set mouse state to "zero" */
168-
#if 0
167+
/* Set mouse state to "zero" */
169168
extern void SDL_ResetMouse(void);
170-
#endif /* 0 */
171169

172170
/* Shutdown the mouse subsystem */
173171
extern void SDL_MouseQuit(void);

src/video/wayland/SDL_waylandmouse.c

-2
Original file line numberDiff line numberDiff line change
@@ -601,7 +601,6 @@ Wayland_EmulateMouseWarpChanged(void *userdata, const char *name, const char *ol
601601
input->warp_emulation_prohibited = !SDL_GetStringBoolean(hint, !input->warp_emulation_prohibited);
602602
}
603603

604-
#if 0 /* TODO RECONNECT: See waylandvideo.c for more information! */
605604
static void
606605
Wayland_RecreateCursor(SDL_Cursor *cursor, SDL_VideoData *vdata)
607606
{
@@ -657,7 +656,6 @@ Wayland_RecreateCursors(void)
657656
}
658657
}
659658
}
660-
#endif /* 0 */
661659

662660
void
663661
Wayland_InitMouse(void)

src/video/wayland/SDL_waylandmouse.h

-2
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@
2727

2828
extern void Wayland_InitMouse(void);
2929
extern void Wayland_FiniMouse(SDL_VideoData *data);
30-
#if 0 /* TODO RECONNECT: See waylandvideo.c for more information! */
3130
extern void Wayland_RecreateCursors(void);
32-
#endif /* 0 */
3331

3432
#endif

src/video/wayland/SDL_waylandsym.h

+2-5
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,8 @@ SDL_WAYLAND_SYM(struct wl_proxy*, wl_proxy_marshal_flags, (struct wl_proxy *prox
8686
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))
8787
#endif
8888

89-
#if 0 /* TODO RECONNECT: See waylandvideo.c for more information! */
90-
#if SDL_WAYLAND_CHECK_VERSION(broken, on, purpose)
91-
SDL_WAYLAND_SYM(int, wl_display_reconnect, (struct wl_display*));
92-
#endif
93-
#endif /* 0 */
89+
SDL_WAYLAND_MODULE(WAYLAND_CLIENT_1_SOON)
90+
SDL_WAYLAND_SYM(int, wl_display_reconnect, (struct wl_display*))
9491

9592
SDL_WAYLAND_INTERFACE(wl_seat_interface)
9693
SDL_WAYLAND_INTERFACE(wl_surface_interface)

src/video/wayland/SDL_waylandvideo.c

+1-5
Original file line numberDiff line numberDiff line change
@@ -1153,7 +1153,6 @@ Wayland_VideoCleanup(_THIS)
11531153
SDL_bool
11541154
Wayland_VideoReconnect(_THIS)
11551155
{
1156-
#if 0 /* TODO RECONNECT: Uncomment all when https://invent.kde.org/plasma/kwin/-/wikis/Restarting is completed */
11571156
SDL_VideoData *data = _this->driverdata;
11581157

11591158
SDL_Window *window = NULL;
@@ -1166,7 +1165,7 @@ Wayland_VideoReconnect(_THIS)
11661165

11671166
SDL_ResetKeyboard();
11681167
SDL_ResetMouse();
1169-
if (WAYLAND_wl_display_reconnect(data->display) < 0) {
1168+
if (!SDL_WAYLAND_HAVE_WAYLAND_CLIENT_1_SOON || WAYLAND_wl_display_reconnect(data->display) < 0) {
11701169
return SDL_FALSE;
11711170
}
11721171

@@ -1193,9 +1192,6 @@ Wayland_VideoReconnect(_THIS)
11931192
SDL_GL_MakeCurrent (current_window, current_ctx);
11941193
}
11951194
return SDL_TRUE;
1196-
#else
1197-
return SDL_FALSE;
1198-
#endif /* 0 */
11991195
}
12001196

12011197
void

0 commit comments

Comments
 (0)