Quellcode durchsuchen

wayland: Remove XDG surface geometry calls

These were needed to fix some buggy behavior regarding committing old buffer sizes when entering fullscreen that has since been corrected. Remove them.
Frank Praznik vor 2 Jahren
Ursprung
Commit
b0a9396b00
1 geänderte Dateien mit 2 neuen und 23 gelöschten Zeilen
  1. 2 23
      src/video/wayland/SDL_waylandwindow.c

+ 2 - 23
src/video/wayland/SDL_waylandwindow.c

@@ -493,20 +493,15 @@ UpdateWindowFullscreen(SDL_Window *window, SDL_bool fullscreen)
 static void
 CommitWindowGeometry(SDL_Window *window)
 {
+#ifdef HAVE_LIBDECOR_H
     SDL_WindowData *wind = (SDL_WindowData *) window->driverdata;
-    SDL_VideoData *viddata = (SDL_VideoData *) wind->waylandData;
 
-#ifdef HAVE_LIBDECOR_H
     if (wind->shell_surface_type == WAYLAND_SURFACE_LIBDECOR && wind->shell_surface.libdecor.frame) {
         struct libdecor_state *state = libdecor_state_new(wind->window_width, wind->window_height);
         libdecor_frame_commit(wind->shell_surface.libdecor.frame, state, NULL);
         libdecor_state_free(state);
-    } else
-#endif
-    if (viddata->shell.xdg && wind->shell_surface.xdg.surface) {
-        xdg_surface_set_window_geometry(wind->shell_surface.xdg.surface, 0, 0,
-                                        wind->window_width, wind->window_height);
     }
+#endif
 }
 
 static const struct wl_callback_listener surface_damage_frame_listener;
@@ -2098,7 +2093,6 @@ static void
 Wayland_HandleResize(SDL_Window *window, int width, int height, float scale)
 {
     SDL_WindowData *data = (SDL_WindowData *) window->driverdata;
-    SDL_VideoData *viddata = data->waylandData;
     const int old_w = window->w, old_h = window->h;
     const int old_drawable_width = data->drawable_width;
     const int old_drawable_height = data->drawable_height;
@@ -2121,21 +2115,6 @@ Wayland_HandleResize(SDL_Window *window, int width, int height, float scale)
         window->h = height;
         data->needs_resize_event = SDL_FALSE;
     }
-
-    /* XXX: This workarounds issues with commiting buffers with old size after
-     * already acknowledging the new size, which can cause protocol violations.
-     * It doesn't fix the first frames after resize being glitched visually,
-     * but at least lets us not be terminated by the compositor.
-     * Can be removed once SDL's resize logic becomes compliant. */
-    if (
-#ifdef HAVE_LIBDECOR_H
-        data->shell_surface_type != WAYLAND_SURFACE_LIBDECOR &&
-#endif
-        viddata->shell.xdg &&
-        data->shell_surface.xdg.surface) {
-        xdg_surface_set_window_geometry(data->shell_surface.xdg.surface, 0, 0,
-                                        data->window_width, data->window_height);
-    }
 }
 
 void