aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@osg.samsung.com>2016-04-07 14:14:14 -0400
committerMike Blumenkrantz <zmike@osg.samsung.com>2016-04-07 14:19:25 -0400
commit0712218537f272593db459806105aa8eeb75b4bb (patch)
treea75c20c2b8e75d48ceb53d2684e2918e2e59f3b1 /src
parentecore-wl2: redo Ecore_Wl2_Event_Window_Configure entirely (diff)
downloadefl-0712218537f272593db459806105aa8eeb75b4bb.tar.gz
wayland: hook engine data from elm_win and update rect with evas size
the only way to accurately calculate the "evas" size in the engine from window geometry is to have the size of the frame available to subtract from window geometry window geometry is NOT framespace--framespace is the entire csd region, possibly containing a shadow, and window geometry is explicitly the region occupied by the window, ie. not the shadowed part. not my ideal solution to the synchronization issue here, but I guess this is a benefit of the unified tree fix https://phab.enlightenment.org/T3396
Diffstat (limited to 'src')
-rw-r--r--src/Makefile_Elementary.am1
-rw-r--r--src/lib/elementary/elm_win.c14
-rw-r--r--src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c29
-rw-r--r--src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_private.h5
4 files changed, 29 insertions, 20 deletions
diff --git a/src/Makefile_Elementary.am b/src/Makefile_Elementary.am
index 3ec83f9b7f..5d2fbbf8cb 100644
--- a/src/Makefile_Elementary.am
+++ b/src/Makefile_Elementary.am
@@ -634,6 +634,7 @@ lib_elementary_libelementary_la_CPPFLAGS = \
-I$(top_srcdir) \
-I$(top_srcdir)/src/static_libs/ \
-I$(top_srcdir)/src/lib/elementary \
+-I$(top_srcdir)/src/modules/ecore_evas/engines/wayland \
-I$(top_builddir)/src/lib/elementary \
-DPACKAGE_DATA_DIR=\"$(datadir)/elementary\" \
-DPACKAGE_BIN_DIR=\"$(bindir)\" \
diff --git a/src/lib/elementary/elm_win.c b/src/lib/elementary/elm_win.c
index 1cdf6b8fcd..b27d7e024b 100644
--- a/src/lib/elementary/elm_win.c
+++ b/src/lib/elementary/elm_win.c
@@ -11,6 +11,9 @@
#include "elm_priv.h"
#include "elm_widget_menu.h"
+#ifdef HAVE_ELEMENTARY_WL2
+# include "ecore_evas_wayland_private.h"
+#endif
#define MY_CLASS ELM_WIN_CLASS
@@ -1264,7 +1267,9 @@ _elm_win_opaque_update(Elm_Win_Data *sd)
{
int ox, oy, ow, oh;
Eina_Bool alpha;
+ Ecore_Evas_Engine_Wl_Data *wdata;
+ wdata = sd->ee->engine.data;
alpha = ecore_evas_alpha_get(sd->ee);
if (alpha)
ecore_wl2_window_opaque_region_set(sd->wl.win, 0, 0, 0, 0);
@@ -1273,12 +1278,18 @@ _elm_win_opaque_update(Elm_Win_Data *sd)
ecore_evas_geometry_get(sd->ee, NULL, NULL, &ow, &oh);
if (!alpha)
ecore_wl2_window_opaque_region_set(sd->wl.win, 0, 0, ow, oh);
+ wdata->content.x = wdata->content.y = 0;
+ wdata->content.w = ow;
+ wdata->content.h = oh;
ecore_wl2_window_geometry_set(sd->wl.win, 0, 0, ow, oh);
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",
+ &wdata->content.x, &wdata->content.y,
+ &wdata->content.w, &wdata->content.h);
if (!alpha)
ecore_wl2_window_opaque_region_set(sd->wl.win, ox, oy, ow, oh);
ecore_wl2_window_geometry_set(sd->wl.win, ox, oy, ow, oh);
@@ -1294,12 +1305,13 @@ _elm_win_frame_obj_update(Elm_Win_Data *sd)
#ifdef HAVE_ELEMENTARY_WL2
sd->wl.opaque_dirty = 1;
#endif
+
if (sd->fullscreen)
{
- evas_output_framespace_set(sd->evas, 0, 0, 0, 0);
#ifdef HAVE_ELEMENTARY_WL2
_elm_win_opaque_update(sd);
#endif
+ evas_output_framespace_set(sd->evas, 0, 0, 0, 0);
return;
}
diff --git a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c
index 41ec06ed06..67086667e5 100644
--- a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c
+++ b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c
@@ -167,7 +167,7 @@ _ecore_evas_wl_common_cb_window_configure(void *data EINA_UNUSED, int type EINA_
Ecore_Evas *ee;
Ecore_Evas_Engine_Wl_Data *wdata;
Ecore_Wl2_Event_Window_Configure *ev;
- int nw = 0, nh = 0, fy = 0;
+ int nw = 0, nh = 0, fw, fh;
Eina_Bool prev_max, prev_full;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
@@ -188,30 +188,23 @@ _ecore_evas_wl_common_cb_window_configure(void *data EINA_UNUSED, int type EINA_
nw = ev->w;
nh = ev->h;
+ fw = wdata->win->geometry.w - wdata->content.w;
+ fh = wdata->win->geometry.h - wdata->content.h;
+
if (prev_full != ee->prop.fullscreen)
_ecore_evas_wl_common_border_update(ee);
if ((prev_max != ee->prop.maximized) ||
(prev_full != ee->prop.fullscreen))
- _ecore_evas_wl_common_state_update(ee);
+ {
+ _ecore_evas_wl_common_state_update(ee);
+ fw = wdata->win->geometry.w - wdata->content.w;
+ fh = wdata->win->geometry.h - wdata->content.h;
+ }
if ((!nw) && (!nh)) return ECORE_CALLBACK_RENEW;
- /* NOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO
- * THIS IS A BUG!
- * NOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO
- * https://phab.enlightenment.org/T3396
- * NOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO
- * ALSO THE COMMENT BELOW THIS IS WRONG!
- */
- /* NB: We receive window configure sizes based on xdg surface
- * window geometry, so we need to subtract framespace here */
- evas_output_framespace_get(ee->evas, NULL, &fy, NULL, NULL);
- nh = (ev->h - fy);
-
- /* NB: This block commented out for now. Unsure this is really needed.
- * Maximize and moving both seem to work fine without this */
- /* if (ee->prop.fullscreen || (ee->x != ev->x) || (ee->y != ev->y)) */
- /* _ecore_evas_wl_common_move(ee, ev->x, ev->y); */
+ nw -= fw;
+ nh -= fh;
if (ee->prop.fullscreen || (ee->req.w != nw) || (ee->req.h != nh))
_ecore_evas_wl_common_resize(ee, nw, nh);
diff --git a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_private.h b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_private.h
index 6aafa8430a..06aff4130b 100644
--- a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_private.h
+++ b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_private.h
@@ -5,6 +5,7 @@
# include "config.h"
#endif
+#ifndef ELEMENTARY_H
//#define LOGFNS 1
#ifdef LOGFNS
# include <stdio.h>
@@ -16,7 +17,6 @@
#include <Eina.h>
#include <Ecore.h>
-#include "ecore_private.h"
#include <Ecore_Input.h>
#include <Ecore_Input_Evas.h>
#include <Ecore_Wayland.h>
@@ -24,6 +24,8 @@
#include "ecore_wl2_private.h"
#include <Ecore_Evas.h>
+#endif
+#include "ecore_private.h"
#include "ecore_evas_private.h"
#include "ecore_evas_wayland.h"
@@ -38,6 +40,7 @@ struct _Ecore_Evas_Engine_Wl_Data
#ifdef BUILD_ECORE_EVAS_WAYLAND_EGL
struct wl_egl_window *egl_win;
#endif
+ Eina_Rectangle content;
struct wl_callback *anim_callback;
int x_rel;
int y_rel;