forked from enlightenment/enlightenment
move wl E_Client creation to same place as E_Pixmap creation
ensure that surface manipulation functions will succeed even with no shell surface
This commit is contained in:
parent
73abc46c61
commit
617c2d96ff
|
@ -1362,6 +1362,7 @@ _e_comp_wl_compositor_cb_surface_create(struct wl_client *client, struct wl_reso
|
||||||
{
|
{
|
||||||
struct wl_resource *res;
|
struct wl_resource *res;
|
||||||
E_Pixmap *ep;
|
E_Pixmap *ep;
|
||||||
|
E_Client *ec;
|
||||||
uint64_t win;
|
uint64_t win;
|
||||||
pid_t pid;
|
pid_t pid;
|
||||||
|
|
||||||
|
@ -1392,9 +1393,14 @@ _e_comp_wl_compositor_cb_surface_create(struct wl_client *client, struct wl_reso
|
||||||
wl_client_post_no_memory(client);
|
wl_client_post_no_memory(client);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
DBG("\tUsing Pixmap: %p", ep);
|
DBG("\tUsing Pixmap: %p", ep);
|
||||||
|
|
||||||
|
ec = e_client_new(ep, 0, 0);
|
||||||
|
ec->new_client = 0;
|
||||||
|
e_comp->new_clients--;
|
||||||
|
ec->client.w = ec->client.h = 1;
|
||||||
|
ec->ignored = 1;
|
||||||
|
|
||||||
/* set reference to pixmap so we can fetch it later */
|
/* set reference to pixmap so we can fetch it later */
|
||||||
wl_resource_set_user_data(res, ep);
|
wl_resource_set_user_data(res, ep);
|
||||||
|
|
||||||
|
|
|
@ -34,6 +34,7 @@ _e_comp_wl_input_pointer_cb_cursor_set(struct wl_client *client, struct wl_resou
|
||||||
pid_t pid;
|
pid_t pid;
|
||||||
E_Client *ec;
|
E_Client *ec;
|
||||||
uint64_t sid;
|
uint64_t sid;
|
||||||
|
Eina_List *l;
|
||||||
Eina_Bool got_mouse = EINA_FALSE;
|
Eina_Bool got_mouse = EINA_FALSE;
|
||||||
|
|
||||||
/* get compositor data */
|
/* get compositor data */
|
||||||
|
@ -56,20 +57,19 @@ _e_comp_wl_input_pointer_cb_cursor_set(struct wl_client *client, struct wl_resou
|
||||||
}
|
}
|
||||||
wl_client_get_credentials(client, &pid, NULL, NULL);
|
wl_client_get_credentials(client, &pid, NULL, NULL);
|
||||||
sid = e_comp_wl_id_get(wl_resource_get_id(surface_resource), pid);
|
sid = e_comp_wl_id_get(wl_resource_get_id(surface_resource), pid);
|
||||||
if (!(ec = e_pixmap_find_client(E_PIXMAP_TYPE_WL, sid)))
|
ec = e_pixmap_find_client(E_PIXMAP_TYPE_WL, sid);
|
||||||
|
if (!ec->re_manage)
|
||||||
{
|
{
|
||||||
Eina_List *l;
|
ec->re_manage = 1;
|
||||||
|
ec->ignored = 0;
|
||||||
|
|
||||||
ec = e_client_new(e_pixmap_new(E_PIXMAP_TYPE_WL, sid), 1, 0);
|
|
||||||
ec->lock_focus_out = ec->layer_block = ec->visible = ec->override = 1;
|
ec->lock_focus_out = ec->layer_block = ec->visible = ec->override = 1;
|
||||||
ec->new_client = 0;
|
|
||||||
e_comp->new_clients--;
|
|
||||||
ec->icccm.title = eina_stringshare_add("noshadow");
|
ec->icccm.title = eina_stringshare_add("noshadow");
|
||||||
evas_object_pass_events_set(ec->frame, 1);
|
evas_object_pass_events_set(ec->frame, 1);
|
||||||
ec->client.w = ec->client.h = 1;
|
e_client_focus_stack_set(eina_list_remove(e_client_focus_stack_get(), ec));
|
||||||
l = e_client_focus_stack_get();
|
EC_CHANGED(ec);
|
||||||
e_client_focus_stack_set(eina_list_remove(l, ec));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ignore cursor changes during resize/move I guess */
|
/* ignore cursor changes during resize/move I guess */
|
||||||
if (e_client_action_get()) return;
|
if (e_client_action_get()) return;
|
||||||
e_pointer_object_set(e_comp->pointer, ec->frame, x, y);
|
e_pointer_object_set(e_comp->pointer, ec->frame, x, y);
|
||||||
|
|
|
@ -566,16 +566,10 @@ _e_shell_cb_shell_surface_get(struct wl_client *client, struct wl_resource *reso
|
||||||
/* find the client for this pixmap */
|
/* find the client for this pixmap */
|
||||||
ec = e_pixmap_client_get(ep);
|
ec = e_pixmap_client_get(ep);
|
||||||
|
|
||||||
if (ec && (!ec->internal))
|
EC_CHANGED(ec);
|
||||||
e_pixmap_ref(ec->pixmap);
|
ec->new_client = ec->netwm.ping = EINA_TRUE;
|
||||||
else if ((!ec) && (!(ec = e_client_new(ep, 0, 0))))
|
e_comp->new_clients++;
|
||||||
{
|
ec->ignored = 0;
|
||||||
wl_resource_post_error(surface_resource,
|
|
||||||
WL_DISPLAY_ERROR_INVALID_OBJECT,
|
|
||||||
"No Client For Pixmap");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
ec->netwm.ping = EINA_TRUE;
|
|
||||||
|
|
||||||
/* get the client data */
|
/* get the client data */
|
||||||
if (!(cdata = ec->comp_data))
|
if (!(cdata = ec->comp_data))
|
||||||
|
@ -1008,7 +1002,6 @@ static void
|
||||||
_e_xdg_shell_surface_configure(struct wl_resource *resource, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h)
|
_e_xdg_shell_surface_configure(struct wl_resource *resource, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h)
|
||||||
{
|
{
|
||||||
E_Client *ec;
|
E_Client *ec;
|
||||||
Eina_Bool new_client;
|
|
||||||
|
|
||||||
/* DBG("XDG_SHELL: Surface Configure: %d \t%d %d %d %d", */
|
/* DBG("XDG_SHELL: Surface Configure: %d \t%d %d %d %d", */
|
||||||
/* wl_resource_get_id(resource), x, y, w, h); */
|
/* wl_resource_get_id(resource), x, y, w, h); */
|
||||||
|
@ -1033,11 +1026,7 @@ _e_xdg_shell_surface_configure(struct wl_resource *resource, Evas_Coord x, Evas_
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ensure resize succeeds */
|
|
||||||
new_client = ec->new_client;
|
|
||||||
ec->new_client = 0;
|
|
||||||
e_client_util_move_resize_without_frame(ec, x, y, w, h);
|
e_client_util_move_resize_without_frame(ec, x, y, w, h);
|
||||||
ec->new_client = new_client;
|
|
||||||
/* TODO: ack configure ?? */
|
/* TODO: ack configure ?? */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1141,17 +1130,10 @@ _e_xdg_shell_cb_surface_get(struct wl_client *client, struct wl_resource *resour
|
||||||
/* find the client for this pixmap */
|
/* find the client for this pixmap */
|
||||||
ec = e_pixmap_client_get(ep);
|
ec = e_pixmap_client_get(ep);
|
||||||
|
|
||||||
if (ec && (!ec->internal))
|
EC_CHANGED(ec);
|
||||||
e_pixmap_ref(ec->pixmap);
|
ec->new_client = ec->netwm.ping = EINA_TRUE;
|
||||||
else if ((!ec) && (!(ec = e_client_new(ep, 0, 0))))
|
e_comp->new_clients++;
|
||||||
{
|
ec->ignored = 0;
|
||||||
wl_resource_post_error(surface_resource,
|
|
||||||
WL_DISPLAY_ERROR_INVALID_OBJECT,
|
|
||||||
"No Client For Pixmap");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
ec->netwm.ping = EINA_TRUE;
|
|
||||||
|
|
||||||
/* get the client data */
|
/* get the client data */
|
||||||
if (!(cdata = ec->comp_data))
|
if (!(cdata = ec->comp_data))
|
||||||
|
@ -1240,16 +1222,6 @@ _e_xdg_shell_cb_popup_get(struct wl_client *client, struct wl_resource *resource
|
||||||
/* find the client for this pixmap */
|
/* find the client for this pixmap */
|
||||||
ec = e_pixmap_client_get(ep);
|
ec = e_pixmap_client_get(ep);
|
||||||
|
|
||||||
if (ec && (!ec->internal))
|
|
||||||
e_pixmap_ref(ec->pixmap);
|
|
||||||
else if ((!ec) && (!(ec = e_client_new(ep, 0, 0))))
|
|
||||||
{
|
|
||||||
wl_resource_post_error(surface_resource,
|
|
||||||
WL_DISPLAY_ERROR_INVALID_OBJECT,
|
|
||||||
"No Client For Pixmap");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* get the client data */
|
/* get the client data */
|
||||||
if (!(cdata = ec->comp_data))
|
if (!(cdata = ec->comp_data))
|
||||||
{
|
{
|
||||||
|
@ -1296,7 +1268,11 @@ _e_xdg_shell_cb_popup_get(struct wl_client *client, struct wl_resource *resource
|
||||||
cdata->shell.map = _e_xdg_shell_surface_map;
|
cdata->shell.map = _e_xdg_shell_surface_map;
|
||||||
cdata->shell.unmap = _e_xdg_shell_surface_unmap;
|
cdata->shell.unmap = _e_xdg_shell_surface_unmap;
|
||||||
|
|
||||||
ec->override = 1;
|
EC_CHANGED(ec);
|
||||||
|
ec->new_client = ec->override = 1;
|
||||||
|
ec->ignored = 0;
|
||||||
|
e_comp->new_clients++;
|
||||||
|
e_client_focus_stack_set(eina_list_remove(e_client_focus_stack_get(), ec));
|
||||||
if (!ec->internal)
|
if (!ec->internal)
|
||||||
ec->borderless = !ec->internal_elm_win;
|
ec->borderless = !ec->internal_elm_win;
|
||||||
ec->lock_border = EINA_TRUE;
|
ec->lock_border = EINA_TRUE;
|
||||||
|
|
Loading…
Reference in New Issue