From fb24955782b9242beb9447ebb6631b2b63921988 Mon Sep 17 00:00:00 2001 From: Chris Michael Date: Fri, 15 Jul 2016 15:30:48 -0400 Subject: [PATCH] elementary: Fix issue of toggling border state causing visual jumps This commit partially fixes a phab ticket where toggling window border state (elm_test -to "Window States") would cause the frame to be destroyed thus making the window contents appear to jump around ref T4092 NB: I call this a 'partial' fix because while it does fix the issue of efl client apps, there is still some breakage in Enlightenment that needs investigating. @fix Signed-off-by: Chris Michael --- src/lib/elementary/efl_ui_win.c | 61 ++++++++++++++++++++++++++++++++++++----- 1 file changed, 54 insertions(+), 7 deletions(-) diff --git a/src/lib/elementary/efl_ui_win.c b/src/lib/elementary/efl_ui_win.c index 3445069..d4f0527 100644 --- a/src/lib/elementary/efl_ui_win.c +++ b/src/lib/elementary/efl_ui_win.c @@ -3700,6 +3700,8 @@ _elm_win_frame_del(Efl_Ui_Win_Data *sd) if (sd->frame_obj) { + edje_object_part_unswallow(sd->frame_obj, sd->edje); + evas_object_event_callback_del_full (sd->frame_obj, EVAS_CALLBACK_MOVE, _elm_win_frame_obj_move, sd); evas_object_event_callback_del_full @@ -3739,6 +3741,56 @@ _elm_win_frame_del(Efl_Ui_Win_Data *sd) ecore_evas_resize(sd->ee, w, h); } +static void +_elm_win_frame_hide(Efl_Ui_Win_Data *sd) +{ + Eina_Bool alpha; + Ecore_Evas_Engine_Wl_Data *wdata; + int x, y, w, h; + int ox, oy, ow, oh; + + if (!sd->frame_obj) return; + + edje_object_part_geometry_get(sd->frame_obj, "elm.spacer.opaque", + &ox, &oy, &ow, &oh); + edje_object_part_geometry_get(sd->frame_obj, "elm.swallow.client", + &x, &y, &w, &h); + + edje_object_part_unswallow(sd->frame_obj, sd->edje); + evas_object_hide(sd->frame_obj); + + /* evas_output_framespace_set(sd->evas, 0, 0, 0, 0); */ + + wdata = sd->ee->engine.data; + wdata->content.x = x; + wdata->content.y = y; + wdata->content.w = w; + wdata->content.h = h; + + alpha = ecore_evas_alpha_get(sd->ee); + if (!alpha) + ecore_wl2_window_opaque_region_set(sd->wl.win, x, y, w, h); + else + ecore_wl2_window_opaque_region_set(sd->wl.win, 0, 0, 0, 0); + + ecore_wl2_window_geometry_set(sd->wl.win, x, y, w, h); + ecore_wl2_window_input_region_set(sd->wl.win, x, y, w, h); +} + +static void +_elm_win_frame_show(Efl_Ui_Win_Data *sd) +{ + if (!sd->frame_obj) return; + edje_object_part_swallow(sd->frame_obj, "elm.swallow.client", + sd->edje); + evas_object_show(sd->frame_obj); + +#ifdef HAVE_ELEMENTARY_WL2 + _elm_win_opaque_update(sd); + _elm_win_frame_obj_update(sd); +#endif +} + #ifdef ELM_DEBUG static void _debug_key_down(void *data EINA_UNUSED, @@ -4920,16 +4972,11 @@ _efl_ui_win_borderless_set(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, Eina_Bool b if (borderless) { - if (need_frame) - _elm_win_frame_del(sd); + if (need_frame) _elm_win_frame_hide(sd); } else { - if (need_frame) - _elm_win_frame_add(sd, "default"); - - if (sd->frame_obj) - evas_object_show(sd->frame_obj); + if (need_frame) _elm_win_frame_show(sd); } TRAP(sd, borderless_set, borderless); -- 2.7.4