ref clients while a wayland shell surface exists

in the case where a client is deleted, it's possible that the shell
surface may persist longer than the duration of the normal client delete
cycle, so it's necessary to ensure that the client will continue to exist
until the shell surface has been destroyed
This commit is contained in:
Mike Blumenkrantz 2015-11-20 14:59:53 -05:00
parent d659b86478
commit a3266d5d89
1 changed files with 7 additions and 0 deletions

View File

@ -98,6 +98,7 @@ _e_shell_surface_destroy(struct wl_resource *resource)
/* get the client for this resource */
if ((ec = wl_resource_get_user_data(resource)))
{
if (!e_object_unref(E_OBJECT(ec))) return;
if (e_object_is_del(E_OBJECT(ec))) return;
if (ec->comp_data)
@ -572,6 +573,8 @@ _e_shell_cb_shell_surface_get(struct wl_client *client, struct wl_resource *reso
&_e_shell_surface_interface,
ec, _e_shell_surface_cb_destroy);
e_object_ref(E_OBJECT(ec));
cdata->shell.configure_send = _e_shell_surface_configure_send;
cdata->shell.configure = _e_shell_surface_configure;
cdata->shell.ping = _e_shell_surface_ping;
@ -1120,6 +1123,8 @@ _e_xdg_shell_cb_surface_get(struct wl_client *client, struct wl_resource *resour
&_e_xdg_surface_interface, ec,
_e_shell_surface_cb_destroy);
e_object_ref(E_OBJECT(ec));
cdata->shell.configure_send = _e_xdg_shell_surface_configure_send;
cdata->shell.configure = _e_xdg_shell_surface_configure;
cdata->shell.ping = _e_xdg_shell_surface_ping;
@ -1207,6 +1212,8 @@ _e_xdg_shell_cb_popup_get(struct wl_client *client, struct wl_resource *resource
wl_resource_set_implementation(cdata->shell.surface,
&_e_xdg_popup_interface, ec, NULL);
e_object_ref(E_OBJECT(ec));
cdata->shell.configure_send = _e_xdg_shell_surface_configure_send;
cdata->shell.configure = _e_xdg_shell_surface_configure;
cdata->shell.ping = _e_xdg_shell_surface_ping;