From ab8985eba8d2ca3b8f07d1ea08258f05c3fd8e72 Mon Sep 17 00:00:00 2001 From: jykeon Date: Thu, 18 Jul 2024 16:04:19 +0900 Subject: [PATCH] elementary: Supports window always top function. Change-Id: I1023e4670b76408622b5588e11a31f66fd669f39 Signed-off-by: jykeon --- src/lib/elementary/efl_ui_win.c | 29 +++++++++++++++++++++++++++++ src/lib/elementary/elm_win_legacy.h | 21 +++++++++++++++++++++ 2 files changed, 50 insertions(+) diff --git a/src/lib/elementary/efl_ui_win.c b/src/lib/elementary/efl_ui_win.c index 7d005f8..bde8a70 100644 --- a/src/lib/elementary/efl_ui_win.c +++ b/src/lib/elementary/efl_ui_win.c @@ -8411,6 +8411,35 @@ elm_win_trap_set(const Elm_Win_Trap *t) return EINA_TRUE; } +//TIZEN_ONLY(20240718): implement elm_win_always_on_top_set and get +EAPI void +elm_win_always_on_top_set(Evas_Object *obj, Eina_Bool pinned) +{ + Efl_Ui_Win_Data *sd = efl_data_scope_safe_get(obj, MY_CLASS); + if (!sd) return; + +#if HAVE_ELEMENTARY_WL2 + _elm_win_wlwindow_get(sd); + if (sd->wl.win) + ecore_wl2_window_pin_mode_set(sd->wl.win, pinned); +#endif +} + +EAPI Eina_Bool +elm_win_always_on_top_get(Evas_Object *obj) +{ + Efl_Ui_Win_Data *sd = efl_data_scope_safe_get(obj, MY_CLASS); + if (!sd) return EINA_FALSE; + +#if HAVE_ELEMENTARY_WL2 + _elm_win_wlwindow_get(sd); + if (sd->wl.win) + return ecore_wl2_window_pin_mode_get(sd->wl.win); +#endif + return EINA_FALSE; +} +// + EAPI void elm_win_floating_mode_set(Evas_Object *obj, Eina_Bool floating) { diff --git a/src/lib/elementary/elm_win_legacy.h b/src/lib/elementary/elm_win_legacy.h index d3128a3..b8fc08f 100644 --- a/src/lib/elementary/elm_win_legacy.h +++ b/src/lib/elementary/elm_win_legacy.h @@ -2364,6 +2364,27 @@ EAPI void elm_win_minimum_size_set(Elm_Win *obj, int w, int h); * @ingroup Elm_Win_Group */ +//TIZEN_ONLY(20240718): add always on top API. +EAPI void elm_win_always_on_top_set(Evas_Object *obj, Eina_Bool pinned); +/** + * @brief Enables or disables the window always is on top. + * + * @param[in] window The window instance. + * @param[in] alwaysOnTop true to enable the window always is on top, false to disable. + * + * @ingroup Elm_Win_Group + */ +EAPI Eina_Bool elm_win_always_on_top_get(Evas_Object *obj); +/** + * @brief Returns whether the window always is on top. + * + * @param[in] window The window instance. + * @return True if the window always is on top, false otherwise. + * + * @ingroup Elm_Win_Group + */ +// + EAPI void elm_win_maximum_size_set(Elm_Win *obj, int w, int h); // -- 2.7.4