automatically mark wayland cursor surfaces as visible during set_cursor

a cursor client should be shown/hidden as needed despite its lack of a
shell interface, and having a special flag to identify these types of
surfaces makes it easier to do that
This commit is contained in:
Mike Blumenkrantz 2016-01-20 15:55:10 -05:00
parent ba40fb5cb4
commit fbedd9dcac
3 changed files with 8 additions and 5 deletions

View File

@ -1070,7 +1070,7 @@ _e_comp_wl_surface_state_commit(E_Client *ec, E_Comp_Wl_Surface_State *state)
{
if ((ec->comp_data->shell.surface) && (ec->comp_data->shell.unmap))
ec->comp_data->shell.unmap(ec->comp_data->shell.surface);
else if (e_client_has_xwindow(ec))
else if (ec->comp_data->cursor || e_client_has_xwindow(ec))
{
ec->visible = EINA_FALSE;
evas_object_hide(ec->frame);
@ -1084,7 +1084,7 @@ _e_comp_wl_surface_state_commit(E_Client *ec, E_Comp_Wl_Surface_State *state)
{
if ((ec->comp_data->shell.surface) && (ec->comp_data->shell.map))
ec->comp_data->shell.map(ec->comp_data->shell.surface);
else if (e_client_has_xwindow(ec))
else if (ec->comp_data->cursor || e_client_has_xwindow(ec))
{
ec->visible = EINA_TRUE;
ec->ignored = 0;
@ -2758,7 +2758,7 @@ e_comp_wl_surface_commit(E_Client *ec)
{
if ((ec->comp_data->shell.surface) && (ec->comp_data->shell.unmap))
ec->comp_data->shell.unmap(ec->comp_data->shell.surface);
else if (e_client_has_xwindow(ec))
else if (ec->comp_data->cursor || e_client_has_xwindow(ec))
{
ec->visible = EINA_FALSE;
evas_object_hide(ec->frame);
@ -2772,7 +2772,7 @@ e_comp_wl_surface_commit(E_Client *ec)
{
if ((ec->comp_data->shell.surface) && (ec->comp_data->shell.map))
ec->comp_data->shell.map(ec->comp_data->shell.surface);
else if (e_client_has_xwindow(ec))
else if (ec->comp_data->cursor || e_client_has_xwindow(ec))
{
ec->visible = EINA_TRUE;
ec->ignored = 0;

View File

@ -300,6 +300,7 @@ struct _E_Comp_Wl_Client_Data
Eina_Bool set_win_type : 1;
Eina_Bool frame_update : 1;
Eina_Bool maximize_pre : 1;
Eina_Bool cursor : 1;
};
struct _E_Comp_Wl_Output

View File

@ -59,12 +59,14 @@ _e_comp_wl_input_pointer_cb_cursor_set(struct wl_client *client, struct wl_resou
ec = wl_resource_get_user_data(surface_resource);
if (!ec->re_manage)
{
ec->re_manage = 1;
ec->comp_data->cursor = ec->re_manage = 1;
ec->ignored = 0;
ec->lock_focus_out = ec->layer_block = ec->visible = ec->override = 1;
ec->icccm.title = eina_stringshare_add("noshadow");
evas_object_pass_events_set(ec->frame, 1);
evas_object_show(ec->frame);
ec->comp_data->mapped = 1;
e_client_focus_stack_set(eina_list_remove(e_client_focus_stack_get(), ec));
EC_CHANGED(ec);
}