add wayland shell private data for managing shell-specific data
also cache xdg configure infos and avoid sending duplicate events
This commit is contained in:
parent
1e615c9917
commit
bfd11c68ca
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue