discomfitor pushed a commit to branch master. http://git.enlightenment.org/core/enlightenment.git/commit/?id=bfd11c68ca0524c1e2dc32a084962a110f54c2ab
commit bfd11c68ca0524c1e2dc32a084962a110f54c2ab Author: Mike Blumenkrantz <zm...@osg.samsung.com> Date: Thu Dec 10 13:24:55 2015 -0500 add wayland shell private data for managing shell-specific data also cache xdg configure infos and avoid sending duplicate events --- src/bin/e_comp_wl.h | 2 ++ src/modules/wl_desktop_shell/e_mod_main.c | 25 +++++++++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/src/bin/e_comp_wl.h b/src/bin/e_comp_wl.h index 814d061..cc8a338 100644 --- a/src/bin/e_comp_wl.h +++ b/src/bin/e_comp_wl.h @@ -49,6 +49,7 @@ typedef struct _E_Comp_Wl_Surface_State E_Comp_Wl_Surface_State; typedef struct _E_Comp_Wl_Client_Data E_Comp_Wl_Client_Data; typedef struct _E_Comp_Wl_Data E_Comp_Wl_Data; typedef struct _E_Comp_Wl_Output E_Comp_Wl_Output; +typedef struct E_Shell_Data E_Shell_Data; struct _E_Comp_Wl_Buffer { @@ -275,6 +276,7 @@ struct _E_Comp_Wl_Client_Data void (*map)(struct wl_resource *resource); void (*unmap)(struct wl_resource *resource); Eina_Rectangle window; + E_Shell_Data *data; } shell; E_Comp_Wl_Buffer_Ref buffer_ref; diff --git a/src/modules/wl_desktop_shell/e_mod_main.c b/src/modules/wl_desktop_shell/e_mod_main.c index c18abad..9935c35 100644 --- a/src/modules/wl_desktop_shell/e_mod_main.c +++ b/src/modules/wl_desktop_shell/e_mod_main.c @@ -5,6 +5,16 @@ #define XDG_SERVER_VERSION 5 +struct E_Shell_Data +{ + uint32_t edges; + uint32_t width; + uint32_t height; + Eina_Bool fullscreen : 1; + Eina_Bool maximized : 1; + Eina_Bool activated : 1; +}; + static void _e_shell_surface_parent_set(E_Client *ec, struct wl_resource *parent_resource) { @@ -103,6 +113,7 @@ _e_shell_surface_destroy(struct wl_resource *resource) if (ec->comp_data) { + E_FREE(ec->comp_data->shell.data); if (ec->comp_data->mapped) { if ((ec->comp_data->shell.surface) && @@ -598,6 +609,7 @@ static void _e_xdg_shell_surface_configure_send(struct wl_resource *resource, uint32_t edges, int32_t width, int32_t height) { E_Client *ec; + E_Shell_Data *shd; struct wl_array states; uint32_t serial; @@ -613,6 +625,18 @@ _e_xdg_shell_surface_configure_send(struct wl_resource *resource, uint32_t edges return; } + shd = ec->comp_data->shell.data; + if ((shd->edges == edges) && (shd->width == width) && (shd->height == height) && + (shd->fullscreen == ec->fullscreen) && + ((!ec->fullscreen) || (shd->maximized == ec->maximized)) && + (shd->activated == ec->focused)) return; + shd->edges = edges; + shd->width = width; + shd->height = height; + shd->fullscreen = ec->fullscreen; + shd->maximized = ec->maximized; + shd->activated = ec->focused; + wl_array_init(&states); if (ec->fullscreen) @@ -1130,6 +1154,7 @@ _e_xdg_shell_cb_surface_get(struct wl_client *client, struct wl_resource *resour cdata->shell.ping = _e_xdg_shell_surface_ping; cdata->shell.map = _e_xdg_shell_surface_map; cdata->shell.unmap = _e_xdg_shell_surface_unmap; + cdata->shell.data = E_NEW(E_Shell_Data, 1); /* set toplevel client properties */ ec->icccm.accepts_focus = 1; --