mirror of
https://github.com/Relintai/sdl2_frt.git
synced 2024-12-16 11:06:49 +01:00
wayland: destroy frame callback when window is destroyed
This commit is contained in:
parent
2092855035
commit
424bbaec06
@ -208,8 +208,9 @@ handle_surface_frame_done(void *data, struct wl_callback *cb, uint32_t time)
|
|||||||
SDL_AtomicSet(&wind->swap_interval_ready, 1); /* mark window as ready to present again. */
|
SDL_AtomicSet(&wind->swap_interval_ready, 1); /* mark window as ready to present again. */
|
||||||
|
|
||||||
/* reset this callback to fire again once a new frame was presented and compositor wants the next one. */
|
/* reset this callback to fire again once a new frame was presented and compositor wants the next one. */
|
||||||
|
wind->frame_callback = wl_surface_frame(wind->surface);
|
||||||
wl_callback_destroy(cb);
|
wl_callback_destroy(cb);
|
||||||
wl_callback_add_listener(wl_surface_frame(wind->surface), &surface_frame_listener, data);
|
wl_callback_add_listener(wind->frame_callback, &surface_frame_listener, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct wl_callback_listener surface_frame_listener = {
|
static const struct wl_callback_listener surface_frame_listener = {
|
||||||
@ -1222,6 +1223,8 @@ void Wayland_DestroyWindow(_THIS, SDL_Window *window)
|
|||||||
|
|
||||||
SDL_free(wind->outputs);
|
SDL_free(wind->outputs);
|
||||||
|
|
||||||
|
wl_callback_destroy(wind->frame_callback);
|
||||||
|
|
||||||
#ifdef SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH
|
#ifdef SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH
|
||||||
if (wind->extended_surface) {
|
if (wind->extended_surface) {
|
||||||
QtExtendedSurface_Unsubscribe(wind->extended_surface, SDL_HINT_QTWAYLAND_CONTENT_ORIENTATION);
|
QtExtendedSurface_Unsubscribe(wind->extended_surface, SDL_HINT_QTWAYLAND_CONTENT_ORIENTATION);
|
||||||
|
@ -54,6 +54,7 @@ typedef struct {
|
|||||||
SDL_Window *sdlwindow;
|
SDL_Window *sdlwindow;
|
||||||
SDL_VideoData *waylandData;
|
SDL_VideoData *waylandData;
|
||||||
struct wl_surface *surface;
|
struct wl_surface *surface;
|
||||||
|
struct wl_callback *frame_callback;
|
||||||
union {
|
union {
|
||||||
SDL_xdg_shell_surface xdg;
|
SDL_xdg_shell_surface xdg;
|
||||||
SDL_zxdg_shell_surface zxdg;
|
SDL_zxdg_shell_surface zxdg;
|
||||||
|
Loading…
Reference in New Issue
Block a user