ecore_wl2: modify the size of configure event 45/285645/1
authorDoyoun Kang <doyoun.kang@samsung.com>
Fri, 16 Dec 2022 01:43:13 +0000 (10:43 +0900)
committerDoyoun Kang <doyoun.kang@samsung.com>
Fri, 16 Dec 2022 01:43:18 +0000 (10:43 +0900)
We change code to determine the size value of ECORE_WL2_EVENT_WINDOW_CONFIGURE event
by considering the size requested by the user.

There was a bug that the window size was changed continuously because of the difference
of the size value between the user requested size and the configure size sent by server.
This patch resolves this problem.

@tizen_only

Change-Id: Id737a16e58e6fca570196a6f5bb6519c8bb85719

src/lib/ecore_wl2/ecore_wl2_private.h
src/lib/ecore_wl2/ecore_wl2_window.c

index b017f6a..922ca47 100644 (file)
@@ -354,6 +354,7 @@ struct _Ecore_Wl2_Window
         Eina_Bool input : 1;
         Eina_Bool fullscreen : 1;
         Eina_Bool maximized : 1;
+        Eina_Bool user_resize : 1;
      } pending;
 
    struct
index e588149..d4d16c2 100644 (file)
@@ -190,21 +190,31 @@ _ecore_wl2_window_configure_send(Ecore_Wl2_Window *win)
                }
              else
                {
-                  if (win->def_config.geometry.w || win->def_config.geometry.h)
+                  if (win->pending.user_resize)
                     {
-                       ev->w = win->def_config.geometry.w;
-                       ev->h = win->def_config.geometry.h;
-                       size_type = 4;
+                       ev->w = win->set_config.geometry.w;
+                       ev->h = win->set_config.geometry.h;
+                       size_type = 6;
                     }
                   else
                     {
-                       // this means that display server didn't consider client's size.
-                       ev->w = 0;
-                       ev->h = 0;
-                       size_type = 5;
+                       if (win->def_config.geometry.w || win->def_config.geometry.h)
+                         {
+                            ev->w = win->def_config.geometry.w;
+                            ev->h = win->def_config.geometry.h;
+                            size_type = 4;
+                         }
+                       else
+                         {
+                            // this means that display server didn't consider client's size.
+                            ev->w = 0;
+                            ev->h = 0;
+                            size_type = 5;
+                         }
                     }
                }
           }
+        win->pending.user_resize = EINA_FALSE;
      }
 /*
    if ((win->set_config.geometry.w == win->def_config.geometry.w) &&
@@ -4423,6 +4433,8 @@ ecore_wl2_window_sync_geometry_set(Ecore_Wl2_Window *window, uint32_t serial, in
    ERR("[WINDOW] ecore_wl2_window_sync_geometry_set, wl2_win-%p moveresize-%p (%d %d %d %d)", window, window->display->wl.tz_moveresize, x, y, w, h);
    //
 
+   window->pending.user_resize = EINA_TRUE;
+
    if (window->display->wl.tz_moveresize)
      tizen_move_resize_set_geometry(window->display->wl.tz_moveresize, window->surface, serial, x, y, w, h);