efl stack wins - add base property/boolean to indicate win is a base
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>
Mon, 19 Dec 2016 06:39:36 +0000 (15:39 +0900)
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>
Tue, 20 Dec 2016 01:57:55 +0000 (10:57 +0900)
part of adding stacks...

src/bin/elementary/test_win_stack.c
src/lib/ecore_x/Ecore_X.h
src/lib/elementary/efl_ui_win.c
src/lib/elementary/efl_ui_win.eo

index 2273c7a..72d8680 100644 (file)
@@ -67,6 +67,7 @@ test_win_stack(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event
    Evas_Object *bg, *bx, *bt, *lb, *win;
 
    win = elm_win_add(NULL, "window-stack", ELM_WIN_BASIC);
+   elm_win_stack_base_set(win, EINA_TRUE);
    elm_win_title_set(win, "Window Stack");
    elm_win_autodel_set(win, EINA_TRUE);
 
index 6654d78..f08d020 100644 (file)
@@ -1382,7 +1382,8 @@ typedef enum _Ecore_X_Illume_Window_State
 typedef enum _Ecore_X_Stack_Type
 {
    ECORE_X_STACK_NONE = 0,
-   ECORE_X_STACK_STANDARD = 1,
+   ECORE_X_STACK_BASE = 1,
+   ECORE_X_STACK_STANDARD,
    ECORE_X_STACK_LAST
 } Ecore_X_Stack_Type;
 
index 4365017..7ae8bf6 100644 (file)
@@ -258,6 +258,7 @@ struct _Efl_Ui_Win_Data
    Eina_Bool    tmp_updating_hints : 1;
    Eina_Bool    single_edje_content: 1; /* hack for E */
    Eina_Bool    shown : 1;
+   Eina_Bool    stack_base : 1;
 };
 
 struct _Input_Pointer_Iterator
@@ -3151,7 +3152,10 @@ _elm_win_xwin_update(Efl_Ui_Win_Data *sd)
         if (win)
           {
              ecore_x_icccm_transient_for_set(sd->x.xwin, win);
-             ecore_x_e_stack_type_set(sd->x.xwin, ECORE_X_STACK_STANDARD);
+             if (sd->stack_base)
+               ecore_x_e_stack_type_set(sd->x.xwin, ECORE_X_STACK_BASE);
+             else
+               ecore_x_e_stack_type_set(sd->x.xwin, ECORE_X_STACK_STANDARD);
           }
      }
    else
@@ -6157,6 +6161,19 @@ _efl_ui_win_stack_master_id_get(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
 }
 
 EOLIAN static void
+_efl_ui_win_stack_base_set(Eo *obj, Efl_Ui_Win_Data *sd, Eina_Bool base)
+{
+   if (sd->shown) return;
+   sd->stack_base = !!base;
+}
+
+EOLIAN static Eina_Bool
+_efl_ui_win_stack_base_get(Eo *obj, Efl_Ui_Win_Data *sd)
+{
+   return sd->stack_base;
+}
+
+EOLIAN static void
 _efl_ui_win_stack_pop_to_id(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd EINA_UNUSED, const char *id EINA_UNUSED)
 {
    // if in e (x11+wl), ask e to nuke all windows in stack above this
index 4a73d96..886b14d 100644 (file)
@@ -772,6 +772,26 @@ class Efl.Ui.Win (Elm.Widget, Efl.Canvas, Elm.Interface.Atspi.Window,
                           display.]]
          }
       }
+      @property stack_base {
+         set {
+            [[Set the stack base state of this window
+
+              This is a boolean flag that determines if this window will
+              become the base of a stack at all. You must enable this
+              on a base (bottom of a window stack for things to work
+              correctly.
+
+              This state should be set before a window is shown for the
+              first time and never changed again after that.
+
+              @since 1.19]]
+         }
+         get {}
+         values {
+            base: bool; [[True if this is a stack base window, false
+                          false otherwise.]]
+         }
+      }
       stack_pop_to_id {
          [[Pop (delete) all windows in the stack above this window.