e_xdg_shell_v6: change condition for client's surface commit
authorJuyeon Lee <juyeonne.lee@samsung.com>
Mon, 26 Nov 2018 04:52:30 +0000 (13:52 +0900)
committerJuyeon Lee <juyeonne.lee@samsung.com>
Tue, 27 Nov 2018 10:56:17 +0000 (19:56 +0900)
whenever client set and unset its user geometry,
configure event with width and height(zero or screen size) is sent to client.
when user geometry gets unset, sometimes client commit serveral times
with invalid size buffer, and right size buffer after a while eventually.
in that case e20 was not adjust its ec->frame size refer to delayed commit(the right size)
because of this issue, make client to be changed by their commit buffer size

in addition to that, added new condition for error
(a commit which attempts configure prior to the first xdg_surface.configure is error)

Change-Id: I1e7279db49fa1fb7bce0be63c82f143b8394c6ca

src/bin/e_xdg_shell_v6.c

index aeb78c46c6566b1657f7a7ba45bea50083fcf9bc..ab6fd79c059af8a418146bef5ac1504e4d9cc95d 100644 (file)
@@ -327,16 +327,19 @@ _e_xdg_toplevel_committed(E_Xdg_Toplevel *toplevel)
    e_pixmap_size_get(ec->pixmap, &pw, &ph);
 
    if ((toplevel->next.state.maximized || toplevel->next.state.fullscreen) &&
-       (toplevel->next.size.w != ec->comp_data->shell.window.w ||
-        toplevel->next.size.h != ec->comp_data->shell.window.h))
+        (toplevel->next.size.w != ec->comp_data->shell.window.w ||
+        toplevel->next.size.h != ec->comp_data->shell.window.h ||
+        toplevel->next.size.w != pw ||
+        toplevel->next.size.h != ph))
      {
         ERR("Xdg_surface buffer does not match the configured state\nmaximized: "
-            "%d fullscreen: %d expected size (%d %d) window size (%d %d)",
+            "%d fullscreen: %d, size:expected(%d %d) shell.request(%d %d) pixmap(%d %d)",
             ec->pixmap, ec,
             toplevel->next.state.maximized,
             toplevel->next.state.fullscreen,
             toplevel->next.size.w, toplevel->next.size.h,
-            ec->comp_data->shell.window.w, ec->comp_data->shell.window.h);
+            ec->comp_data->shell.window.w, ec->comp_data->shell.window.h,
+            pw, ph);
         /* TODO Disable this part for now, but need to consider enabling it later.
          * To enable this part, we first need to ensure that do not send configure
          * with argument of size as 0, and make client ensure that set
@@ -1210,20 +1213,18 @@ _e_xdg_surface_configure(struct wl_resource *resource,
         return;
      }
 
-   if ((exsurf->configured_geometry.x == x) &&
-       (exsurf->configured_geometry.y == y) &&
-       (exsurf->configured_geometry.w == w) &&
-       (exsurf->configured_geometry.h == h))
+   if (!exsurf->configured)
      {
+        // any attempts by a client to attach or manipulate a buffer prior to the first xdg_surface.configure call must
+        // be treated as errors.
+        ERR("Could not handle %s prior to the first xdg_surface.configure",
+           exsurf->ec->pixmap, exsurf->ec,
+           _e_xdg_surface_util_role_string_get(exsurf));
         return;
      }
 
    EINA_RECTANGLE_SET(&exsurf->configured_geometry, x, y, w, h);
 
-   LOG("Configure %s geometry (%d %d %d %d)",
-       exsurf->ec->pixmap, exsurf->ec,
-       _e_xdg_surface_util_role_string_get(exsurf), x, y, w, h);
-
    e_client_util_move_resize_without_frame(exsurf->ec, x, y, w, h);
 }