Browse Source

wayland: Don't print an error when moving a hidden popup window

Repositioning a hidden popup window is valid behavior, so don't print an error message in this case.
Frank Praznik 1 year ago
parent
commit
1bf5a78b53
1 changed files with 3 additions and 2 deletions
  1. 3 2
      src/video/wayland/SDL_waylandwindow.c

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

@@ -2147,8 +2147,9 @@ int Wayland_SetWindowPosition(_THIS, SDL_Window *window)
     SDL_WindowData *wind = window->driverdata;
 
     /* Only popup windows can be positioned relative to the parent. */
-    if (wind->shell_surface_type == WAYLAND_SURFACE_XDG_POPUP && wind->shell_surface.xdg.roleobj.popup.popup) {
-        if (xdg_popup_get_version(wind->shell_surface.xdg.roleobj.popup.popup) < XDG_POPUP_REPOSITION_SINCE_VERSION) {
+    if (wind->shell_surface_type == WAYLAND_SURFACE_XDG_POPUP) {
+        if (wind->shell_surface.xdg.roleobj.popup.popup &&
+            xdg_popup_get_version(wind->shell_surface.xdg.roleobj.popup.popup) < XDG_POPUP_REPOSITION_SINCE_VERSION) {
             return SDL_Unsupported();
         }