e_xdg_shell: check role before adding list while handling configure 17/267917/1
authorDoyoun Kang <doyoun.kang@samsung.com>
Mon, 13 Dec 2021 02:06:40 +0000 (11:06 +0900)
committerDoyoun Kang <doyoun.kang@samsung.com>
Mon, 13 Dec 2021 08:08:58 +0000 (17:08 +0900)
If the surface's role is not TOPLEVEL or POPUP, then e doesnot add configure resource
in the internal list.

Change-Id: Icd092b61f6e37d92e8803c0e447a92ff3b160c2b
Signed-off-by: Doyoun Kang <doyoun.kang@samsung.com>
src/bin/e_xdg_shell_v6.c

index d1f4ff1..8c8d60d 100644 (file)
@@ -1124,6 +1124,7 @@ _e_xdg_surface_cb_configure_send(void *data)
 {
    E_Xdg_Surface *exsurf;
    E_Xdg_Surface_Configure *configure;
+   Eina_Bool wait_ack = EINA_FALSE;
 
    exsurf = data;
 
@@ -1143,7 +1144,6 @@ _e_xdg_surface_cb_configure_send(void *data)
         goto end;
      }
 
-   exsurf->configure_list = eina_list_append(exsurf->configure_list, configure);
    configure->serial = wl_display_next_serial(e_comp_wl->wl.disp);
 
    switch (exsurf->role)
@@ -1153,9 +1153,11 @@ _e_xdg_surface_cb_configure_send(void *data)
          break;
       case E_XDG_SURFACE_ROLE_POPUP:
          _e_xdg_popup_configure_send((E_Xdg_Popup *)exsurf);
+         wait_ack = EINA_TRUE;
          break;
       case E_XDG_SURFACE_ROLE_TOPLEVEL:
          _e_xdg_toplevel_configure_send((E_Xdg_Toplevel *)exsurf, configure);
+         wait_ack = EINA_TRUE;
          break;
      }
 
@@ -1164,6 +1166,11 @@ _e_xdg_surface_cb_configure_send(void *data)
    LOG("Send configure: %s serial %d", exsurf->ec,
        _e_xdg_surface_util_role_string_get(exsurf), configure->serial);
 
+   if (wait_ack)
+     exsurf->configure_list = eina_list_append(exsurf->configure_list, configure);
+   else
+     E_FREE(configure);
+
 end:
    exsurf->configure_idle = NULL;
    return ECORE_CALLBACK_DONE;