redo wayland client unignore mechanism 80/66780/2
authorMike Blumenkrantz <zmike@osg.samsung.com>
Thu, 24 Mar 2016 20:41:18 +0000 (16:41 -0400)
committerDoyoun Kang <doyoun.kang@samsung.com>
Mon, 25 Apr 2016 01:04:44 +0000 (18:04 -0700)
wayland clients were previously set as ignored until they obtained
a shell surface in order to avoid early execution of things like placement.

this had no effect.

the ignore must last until the first commit, at which point surfaces have been
sized and can be placed accurately without needing to move the surface around
a lot of times due to resize/frame adjust/birthdays

Conflicts:
src/bin/e_comp_wl.c
src/modules/wl_desktop_shell/e_mod_main.c

Change-Id: If76b03f5cf93bd3dd0179e1ff382db37bf358894

src/bin/e_comp_wl.c
src/modules/wl_desktop_shell/e_mod_main.c

index 091803f1c167fa422ea84b845c7bffccc20566d2..c22b3c5edc363a1d18da8abe8d7f2f5669965e45 100644 (file)
@@ -1989,7 +1989,18 @@ _e_comp_wl_surface_state_commit(E_Client *ec, E_Comp_Wl_Surface_State *state)
    E_Comp_Wl_Buffer *buffer;
 
    first = !e_pixmap_usable_get(ec->pixmap);
-   ignored = ec->ignored;
+#ifndef HAVE_WAYLAND_ONLY
+   if (first && e_client_has_xwindow(ec))
+     first = !e_pixmap_usable_get(e_comp_x_client_pixmap_get(ec));
+#endif
+
+   if (ec->ignored && (ec->comp_data->shell.surface || ec->internal))
+     {
+        EC_CHANGED(ec);
+        ec->new_client = 1;
+        e_comp->new_clients++;
+        e_client_unignore(ec);
+     }
 
    ec->comp_data->scaler.buffer_viewport = state->buffer_viewport;
 
@@ -2029,7 +2040,9 @@ _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
+             else if (e_client_has_xwindow(ec) || ec->internal ||
+                      (ec->comp_data->sub.data && ec->comp_data->sub.data->parent->comp_data->mapped) ||
+                      (ec == e_comp_wl->drag_client))
                {
                   ec->visible = EINA_FALSE;
                   evas_object_hide(ec->frame);
@@ -2046,7 +2059,9 @@ _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
+             else if (e_client_has_xwindow(ec) || ec->internal ||
+                      (ec->comp_data->sub.data && ec->comp_data->sub.data->parent->comp_data->mapped) ||
+                      (ec == e_comp_wl->drag_client))
                {
                   ec->visible = EINA_TRUE;
                   ec->ignored = 0;
@@ -2106,12 +2121,9 @@ _e_comp_wl_surface_state_commit(E_Client *ec, E_Comp_Wl_Surface_State *state)
           }
 
         if (ec->new_client)
-          ec->placed = placed;
-        else if ((first) && (ec->placed) && (!ec->internal) && (!ec->override) && (ec->lock_client_location))
           {
-             ec->x = ec->y = 0;
-             ec->placed = EINA_FALSE;
-             ec->new_client = EINA_TRUE;
+             ec->placed = placed;
+             ec->want_focus |= ec->icccm.accepts_focus && (!ec->override);
           }
      }
 
@@ -2132,9 +2144,6 @@ _e_comp_wl_surface_state_commit(E_Client *ec, E_Comp_Wl_Surface_State *state)
                                            state->frames);
    state->frames = NULL;
 
-   ec->ignored = ignored;
-   if (!ec->comp_data->mapped) goto unmapped;
-
    buffer = e_pixmap_resource_get(ec->pixmap);
 
    /* put state damages into surface */
@@ -2253,13 +2262,6 @@ _e_comp_wl_surface_state_commit(E_Client *ec, E_Comp_Wl_Surface_State *state)
    state->buffer_viewport.changed = 0;
 
    return;
-
-unmapped:
-   state->buffer_viewport.changed = 0;
-
-   /* clear pending damages */
-   EINA_LIST_FREE(state->damages, dmg)
-     eina_rectangle_free(dmg);
 }
 
 static void
index ff9043df1edff09ca0ce2e5f499691874258069d..15e24b798983a8b6f751c87b93d8bc05388d2ed0 100644 (file)
@@ -543,7 +543,7 @@ _e_shell_cb_shell_surface_get(struct wl_client *client, struct wl_resource *reso
                                "No Pixmap Set On Surface");
         return;
      }
-
+   ec->netwm.ping = 1;
    /* get the client data */
    if (!(cdata = ec->comp_data))
      {
@@ -553,15 +553,6 @@ _e_shell_cb_shell_surface_get(struct wl_client *client, struct wl_resource *reso
         return;
      }
 
-   /* if first creation */
-   if (!cdata->shell.map)
-     {
-        EC_CHANGED(ec);
-        ec->new_client = ec->netwm.ping = EINA_TRUE;
-        e_comp->new_clients++;
-        e_client_unignore(ec);
-     }
-
    /* check for existing shell surface */
    if (cdata->shell.surface)
      {
@@ -1195,6 +1186,8 @@ _e_xdg_shell_cb_surface_get(struct wl_client *client, struct wl_resource *resour
         return;
      }
 
+   ec->netwm.ping = 1;
+
    /* get the client data */
    if (!(cdata = ec->comp_data))
      {
@@ -1204,15 +1197,6 @@ _e_xdg_shell_cb_surface_get(struct wl_client *client, struct wl_resource *resour
         return;
      }
 
-   /* if first creation */
-   if (!cdata->shell.map)
-     {
-        EC_CHANGED(ec);
-        ec->new_client = ec->netwm.ping = EINA_TRUE;
-        e_comp->new_clients++;
-        e_client_unignore(ec);
-     }
-
    /* check for existing shell surface */
    if (cdata->shell.surface)
      {