wayland: Fixed missing window sizing events.
authorRyan C. Gordon <icculus@icculus.org>
Fri, 05 Oct 2018 17:24:03 -0400
changeset 12298c4d5e502c1f4
parent 12296 5b48897016d2
child 12299 d8683d6ff2f8
wayland: Fixed missing window sizing events.

Fixes Bugzilla #4242.
src/video/wayland/SDL_waylandwindow.c
     1.1 --- a/src/video/wayland/SDL_waylandwindow.c	Fri Oct 05 01:41:59 2018 -0700
     1.2 +++ b/src/video/wayland/SDL_waylandwindow.c	Fri Oct 05 17:24:03 2018 -0400
     1.3 @@ -79,19 +79,15 @@
     1.4          }
     1.5      }
     1.6  
     1.7 -    if (width == window->w && height == window->h) {
     1.8 -        return;
     1.9 -    }
    1.10 +    WAYLAND_wl_egl_window_resize(wind->egl_window, width, height, 0, 0);
    1.11 +    region = wl_compositor_create_region(wind->waylandData->compositor);
    1.12 +    wl_region_add(region, 0, 0, width, height);
    1.13 +    wl_surface_set_opaque_region(wind->surface, region);
    1.14 +    wl_region_destroy(region);
    1.15  
    1.16 +    SDL_SendWindowEvent(window, SDL_WINDOWEVENT_RESIZED, width, height);
    1.17      window->w = width;
    1.18      window->h = height;
    1.19 -    WAYLAND_wl_egl_window_resize(wind->egl_window, window->w, window->h, 0, 0);
    1.20 -
    1.21 -    region = wl_compositor_create_region(wind->waylandData->compositor);
    1.22 -    wl_region_add(region, 0, 0, window->w, window->h);
    1.23 -    wl_surface_set_opaque_region(wind->surface, region);
    1.24 -    wl_region_destroy(region);
    1.25 -    SDL_SendWindowEvent(window, SDL_WINDOWEVENT_RESIZED, window->w, window->h);
    1.26  }
    1.27  
    1.28  static void
    1.29 @@ -123,7 +119,6 @@
    1.30      wl_region_add(region, 0, 0, window->w, window->h);
    1.31      wl_surface_set_opaque_region(wind->surface, region);
    1.32      wl_region_destroy(region);
    1.33 -    SDL_SendWindowEvent(window, SDL_WINDOWEVENT_RESIZED, window->w, window->h);
    1.34      zxdg_surface_v6_ack_configure(zxdg, serial);
    1.35  }
    1.36  
    1.37 @@ -165,10 +160,7 @@
    1.38          }
    1.39      }
    1.40  
    1.41 -    if (width == window->w && height == window->h) {
    1.42 -        return;
    1.43 -    }
    1.44 -
    1.45 +    SDL_SendWindowEvent(window, SDL_WINDOWEVENT_RESIZED, width, height);
    1.46      window->w = width;
    1.47      window->h = height;
    1.48  }
    1.49 @@ -202,7 +194,6 @@
    1.50      wl_region_add(region, 0, 0, window->w, window->h);
    1.51      wl_surface_set_opaque_region(wind->surface, region);
    1.52      wl_region_destroy(region);
    1.53 -    SDL_SendWindowEvent(window, SDL_WINDOWEVENT_RESIZED, window->w, window->h);
    1.54      xdg_surface_ack_configure(xdg, serial);
    1.55  }
    1.56  
    1.57 @@ -248,6 +239,7 @@
    1.58          return;
    1.59      }
    1.60  
    1.61 +    SDL_SendWindowEvent(window, SDL_WINDOWEVENT_RESIZED, width, height);
    1.62      window->w = width;
    1.63      window->h = height;
    1.64  }