ref clients while a wayland shell surface exists
authorMike Blumenkrantz <zmike@osg.samsung.com>
Fri, 20 Nov 2015 19:59:53 +0000 (14:59 -0500)
committerMike Blumenkrantz <zmike@osg.samsung.com>
Fri, 20 Nov 2015 20:04:07 +0000 (15:04 -0500)
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

src/modules/wl_desktop_shell/e_mod_main.c

index b817f2b918eec601c5fcb7a443f580435515c069..040c427d675a932203f37850b072e4801d566d22 100644 (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;