ecore_wayland: added ecore_wl_window_stack_mode_set API 81/67881/1 accepted/tizen/common/20160429.170551 accepted/tizen/ivi/20160502.011718 accepted/tizen/mobile/20160502.011616 accepted/tizen/tv/20160502.011632 accepted/tizen/wearable/20160502.011650 submit/tizen/20160429.052526
authorDoyoun Kang <doyoun.kang@samsung.com>
Fri, 29 Apr 2016 04:29:10 +0000 (13:29 +0900)
committerDoyoun Kang <doyoun.kang@samsung.com>
Fri, 29 Apr 2016 04:29:10 +0000 (13:29 +0900)
Change-Id: I99f9d8a0ea344cf3a3d7e18a62dccfa9909d31b8

src/lib/ecore_wayland/Ecore_Wayland.h
src/lib/ecore_wayland/ecore_wl_window.c
src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c
src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_private.h

index 6b858fd..b332084 100644 (file)
@@ -164,6 +164,13 @@ enum _Ecore_Wl_Indicator_Opacity_Mode
    ECORE_WL_INDICATOR_TRANSPARENT
 };
 
+enum _Ecore_Wl_Window_Stack_Mode
+{
+   ECORE_WL_WINDOW_STACK_NONE  = 0,
+   ECORE_WL_WINDOW_STACK_ABOVE = 1,
+   ECORE_WL_WINDOW_STACK_BELOW = 2,
+};
+
 typedef enum _Ecore_Wl_Window_Type Ecore_Wl_Window_Type;
 typedef enum _Ecore_Wl_Window_Buffer_Type Ecore_Wl_Window_Buffer_Type;
 typedef enum _Ecore_Wl_Window_Keygrab_Mode Ecore_Wl_Window_Keygrab_Mode;
@@ -172,6 +179,7 @@ typedef enum _Ecore_Wl_Virtual_Keyboard_State Ecore_Wl_Virtual_Keyboard_State;
 typedef enum _Ecore_Wl_Indicator_State Ecore_Wl_Indicator_State;
 typedef enum _Ecore_Wl_Clipboard_State Ecore_Wl_Clipboard_State;
 typedef enum _Ecore_Wl_Indicator_Opacity_Mode Ecore_Wl_Indicator_Opacity_Mode;
+typedef enum _Ecore_Wl_Window_Stack_Mode Ecore_Wl_Window_Stack_Mode;
 
 /** @since 1.7.6 */
 struct _Ecore_Wl_Global
@@ -806,6 +814,8 @@ EAPI int ecore_wl_window_surface_id_get(Ecore_Wl_Window *win);
 
 EAPI Ecore_Wl_Input *ecore_wl_window_keyboard_get(Ecore_Wl_Window *win);
 
+EAPI void ecore_wl_window_stack_mode_set(Ecore_Wl_Window *win, Ecore_Wl_Window_Stack_Mode mode);
+
 /**
  * Returns a wl_surface with no association to any wl_shell_surface.
  *
index ea2a280..7da2e8b 100644 (file)
@@ -1319,6 +1319,17 @@ ecore_wl_window_keyboard_get(Ecore_Wl_Window *win)
 }
 
 EAPI void
+ecore_wl_window_stack_mode_set(Ecore_Wl_Window *win, Ecore_Wl_Window_Stack_Mode mode)
+{
+   LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
+   if (!win) return;
+
+   if ((win->surface) && (_ecore_wl_disp->wl.tz_policy))
+     tizen_policy_set_stack_mode(_ecore_wl_disp->wl.tz_policy, win->surface, mode);
+}
+
+EAPI void
 ecore_wl_window_rotation_preferred_rotation_set(Ecore_Wl_Window *win, int rot)
 {
    enum tizen_rotation_angle angle = TIZEN_ROTATION_ANGLE_NONE;
index 4c203c8..877e1c4 100644 (file)
@@ -1443,6 +1443,40 @@ end:
      }
 }
 
+static void
+_ecore_evas_wl_layer_update(Ecore_Evas *ee)
+{
+   Ecore_Evas_Engine_Wl_Data *wdata = ee->engine.data;
+
+   if (ee->prop.layer < 3)
+     {
+        if ((wdata->state.above) || (!wdata->state.below))
+          {
+             wdata->state.above = 0;
+             wdata->state.below = 1;
+             ecore_wl_window_stack_mode_set(wdata->win, ECORE_WL_WINDOW_STACK_BELOW);
+          }
+     }
+   else if (ee->prop.layer > 5)
+     {
+        if ((!wdata->state.above) || (wdata->state.below))
+          {
+             wdata->state.above = 1;
+             wdata->state.below = 0;
+             ecore_wl_window_stack_mode_set(wdata->win, ECORE_WL_WINDOW_STACK_ABOVE);
+          }
+     }
+   else
+     {
+        if ((wdata->state.above) || (wdata->state.below))
+          {
+             wdata->state.above = 0;
+             wdata->state.below = 0;
+             ecore_wl_window_stack_mode_set(wdata->win, ECORE_WL_WINDOW_STACK_NONE);
+          }
+     }
+}
+
 void
 _ecore_evas_wl_common_layer_set(Ecore_Evas *ee, int layer)
 {
@@ -1453,6 +1487,8 @@ _ecore_evas_wl_common_layer_set(Ecore_Evas *ee, int layer)
    if (layer < 1) layer = 1;
    else if (layer > 255) layer = 255;
    ee->prop.layer = layer;
+
+   _ecore_evas_wl_layer_update(ee);
    _ecore_evas_wl_common_state_update(ee);
 }
 
index e13f88e..29be2c0 100644 (file)
@@ -42,6 +42,11 @@ struct _Ecore_Evas_Engine_Wl_Data
         unsigned char done : 1;
         Ecore_Job    *manual_mode_job;
      } wm_rot;
+   struct
+     {
+        unsigned char above : 1;
+        unsigned char below : 1;
+     } state;
    struct wl_callback *anim_callback;
 };