forked from enlightenment/efl
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 T3396
This commit is contained in:
parent
5292b3de05
commit
0712218537
|
@ -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)\" \
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue