always create new client for wl shell surfaces
authorMike Blumenkrantz <zmike@osg.samsung.com>
Tue, 10 Mar 2015 22:27:08 +0000 (18:27 -0400)
committerMike Blumenkrantz <zmike@osg.samsung.com>
Tue, 10 Mar 2015 22:27:08 +0000 (18:27 -0400)
this should be a more correct way of handling (shell) surfaces since
there's never a time when we won't want to create a new client

src/modules/wl_desktop_shell/e_mod_main.c

index ee29db0..2a56e98 100644 (file)
@@ -562,19 +562,15 @@ _e_shell_cb_shell_surface_get(struct wl_client *client, struct wl_resource *reso
    /* find the client for this pixmap */
    ec = e_pixmap_client_get(ep);
 
-   if (!ec)
+   if (ec) e_pixmap_ref(ec->pixmap);
+   if (!(ec = e_client_new(NULL, ep, 0, 1)))
      {
-        /* no client found. not internal window. maybe external client app ? */
-        if (!(ec = e_client_new(NULL, ep, 0, 0)))
-          {
-             wl_resource_post_error(surface_resource,
-                                    WL_DISPLAY_ERROR_INVALID_OBJECT,
-                                    "No Client For Pixmap");
-             return;
-          }
-
-        ec->netwm.ping = EINA_TRUE;
+        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 */
    if (!(cdata = ec->comp_data))
@@ -1140,16 +1136,13 @@ _e_xdg_shell_cb_surface_get(struct wl_client *client, struct wl_resource *resour
    /* find the client for this pixmap */
    ec = e_pixmap_client_get(ep);
 
-   if (!ec)
+   if (ec) e_pixmap_ref(ec->pixmap);
+   if (!(ec = e_client_new(NULL, ep, 0, 1)))
      {
-        /* no client found. not internal window. maybe external client app ? */
-        if (!(ec = e_client_new(NULL, ep, 0, 0)))
-          {
-             wl_resource_post_error(surface_resource,
-                                    WL_DISPLAY_ERROR_INVALID_OBJECT,
-                                    "No Client For Pixmap");
-             return;
-          }
+        wl_resource_post_error(surface_resource,
+                               WL_DISPLAY_ERROR_INVALID_OBJECT,
+                               "No Client For Pixmap");
+        return;
      }
 
    ec->netwm.ping = EINA_TRUE;
@@ -1239,18 +1232,13 @@ _e_xdg_shell_cb_popup_get(struct wl_client *client, struct wl_resource *resource
    /* find the client for this pixmap */
    ec = e_pixmap_client_get(ep);
 
-   if (!ec)
+   if (ec) e_pixmap_ref(ec->pixmap);
+   if (!(ec = e_client_new(NULL, ep, 0, 1)))
      {
-        /* no client found. create one */
-        if (!(ec = e_client_new(NULL, ep, 0, 1)))
-          {
-             wl_resource_post_error(surface_resource,
-                                    WL_DISPLAY_ERROR_INVALID_OBJECT,
-                                    "No Client For Pixmap");
-             return;
-          }
-
-        /* e_pixmap_ref(ep); */
+        wl_resource_post_error(surface_resource,
+                               WL_DISPLAY_ERROR_INVALID_OBJECT,
+                               "No Client For Pixmap");
+        return;
      }
 
    /* get the client data */