e_client, wl_desktop_shell: modified code not to map window when the pixmap's size... 72/66572/3 accepted/tizen/common/20160420.140726 accepted/tizen/ivi/20160419.152358 accepted/tizen/mobile/20160419.151628 accepted/tizen/tv/20160419.151925 accepted/tizen/wearable/20160419.152112 submit/tizen/20160419.123130
authorDoyoun Kang <doyoun.kang@samsung.com>
Tue, 19 Apr 2016 12:21:01 +0000 (21:21 +0900)
committerDoyoun Kang <doyoun.kang@samsung.com>
Tue, 19 Apr 2016 12:26:58 +0000 (21:26 +0900)
Change-Id: Ic518c479bb5995de9bae7566e5fac7d9bd6ff4b2

src/bin/e_client.c
src/bin/e_client.h
src/modules/wl_desktop_shell/e_mod_main.c

index aee4e914c3005064552dd348f50c13fc526cded5..8f5d128878ba9c31ab1f96f2564859470ddcefab 100644 (file)
@@ -758,6 +758,8 @@ _e_client_free(E_Client *ec)
    E_FREE_FUNC(ec->kill_timer, ecore_timer_del);
    E_FREE_LIST(ec->pending_resize, free);
 
+   E_FREE_FUNC(ec->map_timer, ecore_timer_del);
+
    if (ec->remember)
      {
         E_Remember *rem;
index 424bded4b51e19c165b0366b6534fa144a9827ac..44af963c9ce2b24a033164a3b9dea941c157b396 100644 (file)
@@ -861,6 +861,8 @@ struct E_Client
            E_Util_Transform_Matrix matrix;
        } parent;
    } transform_core;
+
+   Ecore_Timer *map_timer;
 };
 
 #define e_client_focus_policy_click(ec) \
index 4a0abe7fb36f4e1dce4db5cad994431b6a66d018..bc2ca4e4ffcded64dc0424a2eac0c3bcc26dfd4e 100644 (file)
@@ -1049,6 +1049,36 @@ _e_xdg_shell_surface_ping(struct wl_resource *resource)
      }
 }
 
+static Eina_Bool
+_e_xdg_shell_surface_map_cb_timer(void *data)
+{
+   E_Client *ec = data;
+
+   if (!ec) return ECORE_CALLBACK_CANCEL;
+   if (e_object_is_del(E_OBJECT(ec))) return ECORE_CALLBACK_CANCEL;
+
+   if ((!ec->comp_data->mapped) && (e_pixmap_usable_get(ec->pixmap)))
+     {
+        ELOGF("SHELL",
+              "Map window by map_timer |win:0x%08x|ec_size:%d,%d",
+              ec->pixmap, ec,
+              (unsigned int)e_client_util_win_get(ec),
+              ec->w, ec->h);
+
+        /* map this surface if needed */
+        ec->visible = EINA_TRUE;
+        evas_object_show(ec->frame);
+        ec->comp_data->mapped = EINA_TRUE;
+
+        /* FIXME: sometimes popup surfaces Do Not raise above their
+         * respective parents... */
+        /* if (ec->netwm.type == E_WINDOW_TYPE_POPUP_MENU) */
+        /*   e_client_raise_latest_set(ec); */
+     }
+   ec->map_timer = NULL;
+   return ECORE_CALLBACK_CANCEL;
+}
+
 static void
 _e_xdg_shell_surface_map(struct wl_resource *resource)
 {
@@ -1070,6 +1100,41 @@ _e_xdg_shell_surface_map(struct wl_resource *resource)
 
    if ((!ec->comp_data->mapped) && (e_pixmap_usable_get(ec->pixmap)))
      {
+        int pw = 0;
+        int ph = 0;
+        int cw = ec->w;
+        int ch = ec->h;
+        e_pixmap_size_get(ec->pixmap, &pw, &ph);
+        e_client_geometry_get(ec, NULL, NULL, &cw, &ch);
+
+        if (pw != cw || ph != ch)
+          {
+             if ((ec->changes.need_maximize) ||
+                 (ec->maximized & E_MAXIMIZE_BOTH == E_MAXIMIZE_BOTH))
+               {
+                  // skip. because the pixmap's size doesnot same to ec's size
+                  ELOGF("SHELL",
+                        "Deny Map |win:0x%08x|ec_size:%d,%d|get_size:%d,%d|pix_size:%d,%d",
+                        ec->pixmap, ec,
+                        (unsigned int)e_client_util_win_get(ec),
+                        ec->w, ec->h, cw, ch, pw, ph);
+
+                  if (!ec->map_timer)
+                    ec->map_timer = ecore_timer_add(3.0, _e_xdg_shell_surface_map_cb_timer, ec);
+
+                  TRACE_DS_END();
+                  return;
+               }
+          }
+
+        E_FREE_FUNC(ec->map_timer, ecore_timer_del);
+
+        ELOGF("SHELL",
+              "Map window  |win:0x%08x|ec_size:%d,%d",
+              ec->pixmap, ec,
+              (unsigned int)e_client_util_win_get(ec),
+              ec->w, ec->h);
+
         /* map this surface if needed */
         ec->visible = EINA_TRUE;
         evas_object_show(ec->frame);
@@ -1103,6 +1168,8 @@ _e_xdg_shell_surface_unmap(struct wl_resource *resource)
         return;
      }
 
+   E_FREE_FUNC(ec->map_timer, ecore_timer_del);
+
    if (ec->comp_data->mapped)
      {
         ec->visible = EINA_FALSE;