aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/elementary/efl_ui_win.c
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2016-11-22 17:59:33 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2016-11-23 13:04:13 +0900
commit29e7d477b1001c106dda45dbf434729831cb97a5 (patch)
treea141adebbd1ca17c8cf64540f4c922f68f87b913 /src/lib/elementary/efl_ui_win.c
parentwin: Fix support for legacy themes (elm_bg) (diff)
downloadefl-29e7d477b1001c106dda45dbf434729831cb97a5.tar.gz
win: Simplify modal legacy API and add test case
This fixes the modality of windows shown after setting the flag.
Diffstat (limited to 'src/lib/elementary/efl_ui_win.c')
-rw-r--r--src/lib/elementary/efl_ui_win.c36
1 files changed, 9 insertions, 27 deletions
diff --git a/src/lib/elementary/efl_ui_win.c b/src/lib/elementary/efl_ui_win.c
index 537e1aee39..2710fd81d6 100644
--- a/src/lib/elementary/efl_ui_win.c
+++ b/src/lib/elementary/efl_ui_win.c
@@ -2155,9 +2155,6 @@ _efl_ui_win_show(Eo *obj, Efl_Ui_Win_Data *sd)
return;
}
- if (!evas_object_visible_get(obj)) do_eval = EINA_TRUE;
- efl_gfx_visible_set(efl_super(obj, MY_CLASS), EINA_TRUE);
-
if ((sd->modal) && (!evas_object_visible_get(obj)))
{
const Eina_List *l;
@@ -2165,6 +2162,9 @@ _efl_ui_win_show(Eo *obj, Efl_Ui_Win_Data *sd)
INCREMENT_MODALITY()
}
+ if (!evas_object_visible_get(obj)) do_eval = EINA_TRUE;
+ efl_gfx_visible_set(efl_super(obj, MY_CLASS), EINA_TRUE);
+
if (sd->deferred_resize_job)
_elm_win_resize_job(sd->obj);
evas_smart_objects_calculate(evas_object_evas_get(obj));
@@ -7268,37 +7268,19 @@ elm_win_demand_attention_get(const Evas_Object *obj)
EAPI void
elm_win_modal_set(Evas_Object *obj, Eina_Bool modal)
{
- ELM_WIN_CHECK(obj);
- ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
-
- if (sd->modal_count) return;
-
- const Eina_List *l;
- Evas_Object *current;
+ Efl_Ui_Win_Modal_Mode modality;
- if ((modal) && (!sd->modal) && (evas_object_visible_get(obj)))
- {
- INCREMENT_MODALITY()
- }
- else if ((!modal) && (sd->modal) && (evas_object_visible_get(obj)))
- {
- DECREMENT_MODALITY()
- }
-
- sd->modal = modal;
- TRAP(sd, modal_set, modal);
-#ifdef HAVE_ELEMENTARY_X
- _elm_win_xwin_update(sd);
-#endif
+ modality = modal ? EFL_UI_WIN_MODAL_MODAL : EFL_UI_WIN_MODAL_NONE;
+ efl_ui_win_modal_set(obj, modality);
}
EAPI Eina_Bool
elm_win_modal_get(const Evas_Object *obj)
{
- ELM_WIN_CHECK(obj) EINA_FALSE;
- ELM_WIN_DATA_GET_OR_RETURN(obj, sd, EINA_FALSE);
+ Efl_Ui_Win_Modal_Mode modality;
- return sd->modal;
+ modality = efl_ui_win_modal_get(obj);
+ return (modality != EFL_UI_WIN_MODAL_NONE);
}
EAPI void