add e_client_unignore() for triggering events when unignoring a client

mainly for use in wayland compositing since all surfaces are ignored
until they get a shell surface or a commit
This commit is contained in:
Mike Blumenkrantz 2015-07-17 15:29:13 -04:00
parent 51c74889cf
commit bd776b157f
5 changed files with 28 additions and 5 deletions

View File

@ -2453,6 +2453,17 @@ e_client_shutdown(void)
warp_client = NULL;
}
E_API void
e_client_unignore(E_Client *ec)
{
E_OBJECT_CHECK(ec);
E_OBJECT_TYPE_CHECK(ec, E_CLIENT_TYPE);
if (!ec->ignored) return;
ec->ignored = 0;
_e_client_event_simple(ec, E_EVENT_CLIENT_ADD);
}
E_API E_Client *
e_client_new(E_Pixmap *cp, int first_map, int internal)
{
@ -2555,7 +2566,8 @@ e_client_new(E_Pixmap *cp, int first_map, int internal)
e_comp->clients = eina_list_append(e_comp->clients, ec);
eina_hash_add(clients_hash[e_pixmap_type_get(cp)], &ec->pixmap, ec);
_e_client_event_simple(ec, E_EVENT_CLIENT_ADD);
if (!ec->ignored)
_e_client_event_simple(ec, E_EVENT_CLIENT_ADD);
e_comp_object_client_add(ec);
if (ec->frame)
{

View File

@ -748,6 +748,7 @@ EINTERN void e_client_idler_before(void);
EINTERN Eina_Bool e_client_init(void);
EINTERN void e_client_shutdown(void);
E_API E_Client *e_client_new(E_Pixmap *cp, int first_map, int internal);
E_API void e_client_unignore(E_Client *ec);
E_API void e_client_desk_set(E_Client *ec, E_Desk *desk);
E_API Eina_Bool e_client_comp_grabbed_get(void);
E_API E_Client *e_client_action_get(void);

View File

@ -5433,7 +5433,8 @@ e_comp_x_xwayland_client_setup(E_Client *ec, E_Client *wc)
if (pwin)
eina_hash_set(clients_win_hash, &pwin, wc);
wc->visible = 1;
wc->ignored = 0;
if (wc->ignored)
e_client_unignore(wc);
if (ec->override)
e_client_focus_stack_set(eina_list_remove(e_client_focus_stack_get(), wc));
evas_object_name_set(wc->frame, evas_object_name_get(ec->frame));

View File

@ -660,6 +660,14 @@ _comp_object_add(E_Smart_Data *sd, int type EINA_UNUSED, E_Event_Comp_Object *ev
return ECORE_CALLBACK_RENEW;
}
static Eina_Bool
_client_add(E_Smart_Data *sd, int type EINA_UNUSED, E_Event_Client *ev)
{
if (!eina_hash_find(sd->mirror_hash, &ev->ec->frame))
_e_deskmirror_mirror_add(sd, ev->ec->frame);
return ECORE_CALLBACK_RENEW;
}
static Eina_Bool
_client_desk_set(E_Smart_Data *sd, int type EINA_UNUSED, E_Event_Client_Desk_Set *ev)
{
@ -745,6 +753,7 @@ e_deskmirror_add(E_Desk *desk, Eina_Bool pager, Eina_Bool taskbar)
e_layout_thaw(sd->layout);
E_LIST_HANDLER_APPEND(sd->handlers, E_EVENT_COMP_OBJECT_ADD, (Ecore_Event_Handler_Cb)_comp_object_add, sd);
E_LIST_HANDLER_APPEND(sd->handlers, E_EVENT_CLIENT_ADD, (Ecore_Event_Handler_Cb)_client_add, sd);
E_LIST_HANDLER_APPEND(sd->handlers, E_EVENT_CLIENT_PROPERTY, (Ecore_Event_Handler_Cb)_client_property, sd);
E_LIST_HANDLER_APPEND(sd->handlers, E_EVENT_CLIENT_DESK_SET, (Ecore_Event_Handler_Cb)_client_desk_set, sd);
return o;

View File

@ -540,7 +540,7 @@ _e_shell_cb_shell_surface_get(struct wl_client *client, struct wl_resource *reso
EC_CHANGED(ec);
ec->new_client = ec->netwm.ping = EINA_TRUE;
e_comp->new_clients++;
ec->ignored = 0;
e_client_unignore(ec);
/* get the client data */
if (!(cdata = ec->comp_data))
@ -1088,7 +1088,7 @@ _e_xdg_shell_cb_surface_get(struct wl_client *client, struct wl_resource *resour
EC_CHANGED(ec);
ec->new_client = ec->netwm.ping = EINA_TRUE;
e_comp->new_clients++;
ec->ignored = 0;
e_client_unignore(ec);
/* get the client data */
if (!(cdata = ec->comp_data))
@ -1216,7 +1216,7 @@ _e_xdg_shell_cb_popup_get(struct wl_client *client, struct wl_resource *resource
EC_CHANGED(ec);
ec->new_client = ec->override = 1;
ec->ignored = 0;
e_client_unignore(ec);
e_comp->new_clients++;
e_client_focus_stack_set(eina_list_remove(e_client_focus_stack_get(), ec));
if (!ec->internal)