aboutsummaryrefslogtreecommitdiffstats
path: root/legacy/elementary/src/lib/elm_win.c
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@osg.samsung.com>2015-07-20 17:35:00 -0400
committerMike Blumenkrantz <zmike@osg.samsung.com>2015-07-20 17:35:00 -0400
commit79014251a2ade56d4d1ff30a337129899338a6dd (patch)
tree2dea9ce8364011218c8701410cbdb78e35c0d2d3 /legacy/elementary/src/lib/elm_win.c
parentelementary: Adjust shadow spacer on maximize (diff)
downloadefl-79014251a2ade56d4d1ff30a337129899338a6dd.tar.gz
win: redo wayland opaque region setting
* convert opaque region theme part to SPACER - add rels for shaded/maximized state * namespace opaque region theme part * update opaque region only on pre-render - fixes race condition between render size and opaque size ref https://phab.enlightenment.org/T2575
Diffstat (limited to 'legacy/elementary/src/lib/elm_win.c')
-rw-r--r--legacy/elementary/src/lib/elm_win.c62
1 files changed, 43 insertions, 19 deletions
diff --git a/legacy/elementary/src/lib/elm_win.c b/legacy/elementary/src/lib/elm_win.c
index 5c70a99f02..4c9933767a 100644
--- a/legacy/elementary/src/lib/elm_win.c
+++ b/legacy/elementary/src/lib/elm_win.c
@@ -115,6 +115,7 @@ struct _Elm_Win_Data
struct
{
Ecore_Wl_Window *win;
+ Eina_Bool opaque_dirty : 1;
} wl;
#endif
@@ -1226,40 +1227,45 @@ _elm_win_profile_update(Elm_Win_Data *sd)
eo_do(sd->obj, eo_event_callback_call(ELM_WIN_EVENT_PROFILE_CHANGED, NULL));
}
+#ifdef HAVE_ELEMENTARY_WAYLAND
static void
-_elm_win_frame_obj_update(Elm_Win_Data *sd)
+_elm_win_opaque_update(Elm_Win_Data *sd)
{
- int fx, fy, fw, fh;
int ox, oy, ow, oh;
- int x, y, w, h;
if (sd->fullscreen)
{
- evas_output_framespace_set(sd->evas, 0, 0, 0, 0);
-#ifdef HAVE_ELEMENTARY_WAYLAND
ecore_evas_geometry_get(sd->ee, NULL, NULL, &ow, &oh);
ecore_wl_window_opaque_region_set(sd->wl.win, 0, 0, ow, oh);
return;
-#endif
}
- evas_object_geometry_get(sd->frame_obj, &fx, &fy, &fw, &fh);
- evas_object_geometry_get(sd->client_obj, &ox, &oy, &ow, &oh);
- evas_output_framespace_get(sd->evas, &x, &y, &w, &h);
+ edje_object_part_geometry_get(sd->frame_obj, "elm.spacer.opaque",
+ &ox, &oy, &ow, &oh);
+ DBG("Opaque: %d %d %d %d", ox, oy, ow, oh);
+ ecore_wl_window_opaque_region_set(sd->wl.win, ox, oy, ow - 50, oh);//ow - ox, oh - oy);
+}
+#endif
- if ((x != (ox - fx)) || (y != (oy - fy)) ||
- (w != (fw - ow)) || (h != (fh - oh)))
- {
- evas_output_framespace_set(sd->evas, (ox - fx), (oy - fy),
- (fw - ow), (fh - oh));
- }
+static void
+_elm_win_frame_obj_update(Elm_Win_Data *sd)
+{
+ int fx, fy, fw, fh;
+ int ox, oy, ow, oh;
#ifdef HAVE_ELEMENTARY_WAYLAND
- edje_object_part_geometry_get(sd->frame_obj, "opaque_region",
- &ox, &oy, &ow, &oh);
- DBG("Opaque: %d %d %d %d", ox, oy, ow, oh);
- ecore_wl_window_opaque_region_set(sd->wl.win, ox, oy, ow, oh);//ow - ox, oh - oy);
+ sd->wl.opaque_dirty = 1;
#endif
+ if (sd->fullscreen)
+ {
+ evas_output_framespace_set(sd->evas, 0, 0, 0, 0);
+ return;
+ }
+
+ evas_object_geometry_get(sd->frame_obj, &fx, &fy, &fw, &fh);
+ evas_object_geometry_get(sd->client_obj, &ox, &oy, &ow, &oh);
+
+ evas_output_framespace_set(sd->evas, (ox - fx), (oy - fy), (fw - ow), (fh - oh));
}
static void
@@ -2854,6 +2860,18 @@ _elm_win_frame_cb_close(void *data,
evas_object_unref(win);
}
+#ifdef HAVE_ELEMENTARY_WAYLAND
+static void
+_elm_win_frame_pre_render(void *data, Evas *e EINA_UNUSED, void *ev EINA_UNUSED)
+{
+ Elm_Win_Data *sd = data;
+
+ if (sd->wl.opaque_dirty)
+ _elm_win_opaque_update(sd);
+ sd->wl.opaque_dirty = 0;
+}
+#endif
+
static void
_elm_win_frame_add(Elm_Win_Data *sd,
const char *style)
@@ -2902,6 +2920,9 @@ _elm_win_frame_add(Elm_Win_Data *sd,
(sd->frame_obj, EVAS_CALLBACK_MOVE, _elm_win_frame_obj_move, sd);
evas_object_event_callback_add
(sd->frame_obj, EVAS_CALLBACK_RESIZE, _elm_win_frame_obj_resize, sd);
+#ifdef HAVE_ELEMENTARY_WAYLAND
+ evas_event_callback_add(sd->evas, EVAS_CALLBACK_RENDER_PRE, _elm_win_frame_pre_render, sd);
+#endif
/* NB: Do NOT remove these calls !! Needed to calculate proper
* framespace on inital show of the window */
@@ -2957,6 +2978,9 @@ _elm_win_frame_del(Elm_Win_Data *sd)
(sd->frame_obj, EVAS_CALLBACK_MOVE, _elm_win_frame_obj_move, sd);
evas_object_event_callback_del_full
(sd->frame_obj, EVAS_CALLBACK_RESIZE, _elm_win_frame_obj_resize, sd);
+#ifdef HAVE_ELEMENTARY_WAYLAND
+ evas_event_callback_del_full(sd->evas, EVAS_CALLBACK_RENDER_PRE, _elm_win_frame_pre_render, sd);
+#endif
edje_object_signal_callback_del
(sd->frame_obj, "elm,action,move,start", "elm",