From ac2249d1525bc558d4138a503d73a35f34bc91c5 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Thu, 10 Dec 2015 11:53:56 -0500 Subject: [PATCH] move comp canvas resize callback to monitor elm win geometry elm win intercepts this callback in order to maintain internal sizing for use with elm widgets on the compositor canvas, so it's necessary to get the callback from this object in order to accurately update the canvas during resizes --- src/bin/e_comp.c | 12 ++++++++++++ src/bin/e_comp_canvas.c | 8 -------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/bin/e_comp.c b/src/bin/e_comp.c index fb5a88324..1c38f4847 100644 --- a/src/bin/e_comp.c +++ b/src/bin/e_comp.c @@ -989,6 +989,17 @@ _e_comp_act_redirect_toggle_go(E_Object * obj EINA_UNUSED, const char *params EI ////////////////////////////////////////////////////////////////////////// +static void +_e_comp_resize(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED) +{ + int w, h; + + evas_object_geometry_get(obj, NULL, NULL, &w, &h); + if ((w == e_comp->w) && (h == e_comp->h)) return; + e_randr2_screens_setup(w, h); + e_comp_canvas_update(); +} + EINTERN Eina_Bool e_comp_init(void) { @@ -1131,6 +1142,7 @@ out: e_screensaver_update(); } e_comp->elm = elm_win_fake_add(e_comp->ee); + evas_object_event_callback_add(e_comp->elm, EVAS_CALLBACK_RESIZE, _e_comp_resize, NULL); elm_win_fullscreen_set(e_comp->elm, 1); evas_object_show(e_comp->elm); e_util_env_set("HYBRIS_EGLPLATFORM", NULL); diff --git a/src/bin/e_comp_canvas.c b/src/bin/e_comp_canvas.c index a3d8401a5..518f6b6bc 100644 --- a/src/bin/e_comp_canvas.c +++ b/src/bin/e_comp_canvas.c @@ -217,13 +217,6 @@ _e_comp_canvas_cb_zone_sort(const void *data1, const void *data2) return z1->num - z2->num; } -static void -_e_comp_canvas_resize(Ecore_Evas *ee EINA_UNUSED) -{ - e_randr2_screens_setup(e_comp->w, e_comp->h); - e_comp_canvas_update(); -} - static void _e_comp_canvas_prerender(Ecore_Evas *ee EINA_UNUSED) { @@ -292,7 +285,6 @@ e_comp_canvas_init(int w, int h) E_LIST_HANDLER_APPEND(handlers, E_EVENT_SCREENSAVER_OFF, _e_comp_cb_screensaver_off, NULL); ecore_evas_callback_pre_render_set(e_comp->ee, _e_comp_canvas_prerender); - ecore_evas_callback_resize_set(e_comp->ee, _e_comp_canvas_resize); ecore_evas_resize(e_comp->ee, w, h); return EINA_TRUE;