From: Gwanglim Lee Date: Thu, 23 Nov 2017 23:59:19 +0000 (+0900) Subject: e_comp_wl_shell: send toplevel v6 configure event before client window is mapped X-Git-Tag: accepted/tizen/unified/20180328.010351~19 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0d288ef42e0c056e14db91eac49a4ee15e0891e0;p=platform%2Fupstream%2Fenlightenment.git e_comp_wl_shell: send toplevel v6 configure event before client window is mapped Change-Id: I26bca33fd9c5e1ae8ed9f7201e5a0c4f717d48f5 --- diff --git a/src/bin/e_comp_wl_shell.c b/src/bin/e_comp_wl_shell.c index 4361715..4184d59 100644 --- a/src/bin/e_comp_wl_shell.c +++ b/src/bin/e_comp_wl_shell.c @@ -1656,9 +1656,12 @@ _e_xdg_surf_v6_configure_send(struct wl_resource *res_xdg_surf_v6, int32_t height) { E_Client *ec; + E_Comp_Client_Data *cdata; + struct wl_array states; uint32_t serial; + struct wl_resource *resource; - if (!res_xdg_surf_v6) return; + EINA_SAFETY_ON_NULL_RETURN(res_xdg_surf_v6); ec = wl_resource_get_user_data(res_xdg_surf_v6); if (!ec) @@ -1669,10 +1672,50 @@ _e_xdg_surf_v6_configure_send(struct wl_resource *res_xdg_surf_v6, return; } + cdata = ec->comp_data; + EINA_SAFETY_ON_NULL_RETURN(cdata); + EINA_SAFETY_ON_NULL_RETURN(cdata->sh_v6.res_role); + + resource = cdata->sh_v6.res_role; + + wl_array_init(&states); + + if (ec->fullscreen) + { + _e_xdg_surface_state_add(resource, &states, ZXDG_TOPLEVEL_V6_STATE_FULLSCREEN); + + // send fullscreen size + if ((width == 0) && (height == 0)) + { + width = ec->client.w && ec->client.h? ec->client.w : ec->w; + height = ec->client.w && ec->client.h? ec->client.h : ec->h; + } + } + else if (ec->maximized) + { + _e_xdg_surface_state_add(resource, &states, ZXDG_TOPLEVEL_V6_STATE_MAXIMIZED); + + // send maximized size + if ((width == 0) && (height == 0)) + { + width = ec->client.w && ec->client.h? ec->client.w : ec->w; + height = ec->client.w && ec->client.h? ec->client.h : ec->h; + } + } + + if (edges != 0) + _e_xdg_surface_state_add(resource, &states, ZXDG_TOPLEVEL_V6_STATE_RESIZING); + + if (ec->focused) + _e_xdg_surface_state_add(resource, &states, ZXDG_TOPLEVEL_V6_STATE_ACTIVATED); + + zxdg_toplevel_v6_send_configure(cdata->sh_v6.res_role, width, height, &states); serial = wl_display_next_serial(e_comp_wl->wl.disp); zxdg_surface_v6_send_configure(res_xdg_surf_v6, serial); - ELOGF("SH", "SEND configure v6", ec->pixmap, ec); + wl_array_release(&states); + + ELOGF("SH", "SEND configure v6 %dx%d", ec->pixmap, ec, width, height); } static void