forked from enlightenment/efl
ecore_wl2: Replace direct usage of set_config.geometry with getters
I'm going to deal with some ugly geometry problems in the getter func shortly. Signed-off-by: Derek Foreman <derek.foreman.samsung@gmail.com> Reviewed-by: Chris Michael <cp.michael@samsung.com> Differential Revision: https://phab.enlightenment.org/D7431
This commit is contained in:
parent
b32e5da641
commit
f53c7341c3
|
@ -304,17 +304,16 @@ static const struct xdg_popup_listener _xdg_popup_listener =
|
||||||
static void
|
static void
|
||||||
_ecore_wl2_window_xdg_popup_create(Ecore_Wl2_Window *win)
|
_ecore_wl2_window_xdg_popup_create(Ecore_Wl2_Window *win)
|
||||||
{
|
{
|
||||||
|
int gx, gy, gw, gh;
|
||||||
struct xdg_positioner *pos;
|
struct xdg_positioner *pos;
|
||||||
|
|
||||||
EINA_SAFETY_ON_NULL_RETURN(win->parent);
|
EINA_SAFETY_ON_NULL_RETURN(win->parent);
|
||||||
pos = xdg_wm_base_create_positioner(win->display->wl.xdg_wm_base);
|
pos = xdg_wm_base_create_positioner(win->display->wl.xdg_wm_base);
|
||||||
if (!pos) return;
|
if (!pos) return;
|
||||||
|
|
||||||
xdg_positioner_set_anchor_rect(pos, win->set_config.geometry.x,
|
ecore_wl2_window_geometry_get(win, &gx, &gy, &gw, &gh);
|
||||||
win->set_config.geometry.y,
|
xdg_positioner_set_anchor_rect(pos, gx, gy, 1, 1);
|
||||||
1, 1);
|
xdg_positioner_set_size(pos, gw, gh);
|
||||||
xdg_positioner_set_size(pos, win->set_config.geometry.w,
|
|
||||||
win->set_config.geometry.h);
|
|
||||||
xdg_positioner_set_anchor(pos, XDG_POSITIONER_ANCHOR_TOP_LEFT);
|
xdg_positioner_set_anchor(pos, XDG_POSITIONER_ANCHOR_TOP_LEFT);
|
||||||
xdg_positioner_set_gravity(pos, ZXDG_POSITIONER_V6_ANCHOR_BOTTOM |
|
xdg_positioner_set_gravity(pos, ZXDG_POSITIONER_V6_ANCHOR_BOTTOM |
|
||||||
ZXDG_POSITIONER_V6_ANCHOR_RIGHT);
|
ZXDG_POSITIONER_V6_ANCHOR_RIGHT);
|
||||||
|
@ -408,20 +407,18 @@ _ecore_wl2_window_shell_surface_init(Ecore_Wl2_Window *window)
|
||||||
{
|
{
|
||||||
if (window->uuid)
|
if (window->uuid)
|
||||||
{
|
{
|
||||||
|
int gx, gy, gw, gh;
|
||||||
|
|
||||||
zwp_e_session_recovery_set_uuid(window->display->wl.session_recovery,
|
zwp_e_session_recovery_set_uuid(window->display->wl.session_recovery,
|
||||||
window->surface, window->uuid);
|
window->surface, window->uuid);
|
||||||
|
|
||||||
|
ecore_wl2_window_geometry_get(window, &gx, &gy, &gw, &gh);
|
||||||
if (window->xdg_surface)
|
if (window->xdg_surface)
|
||||||
xdg_surface_set_window_geometry(window->xdg_surface,
|
xdg_surface_set_window_geometry(window->xdg_surface,
|
||||||
window->set_config.geometry.x,
|
gx, gy, gw, gh);
|
||||||
window->set_config.geometry.y,
|
|
||||||
window->set_config.geometry.w,
|
|
||||||
window->set_config.geometry.h);
|
|
||||||
if (window->zxdg_surface)
|
if (window->zxdg_surface)
|
||||||
zxdg_surface_v6_set_window_geometry(window->zxdg_surface,
|
zxdg_surface_v6_set_window_geometry(window->zxdg_surface,
|
||||||
window->set_config.geometry.x,
|
gx, gy, gw, gh);
|
||||||
window->set_config.geometry.y,
|
|
||||||
window->set_config.geometry.w,
|
|
||||||
window->set_config.geometry.h);
|
|
||||||
|
|
||||||
ecore_wl2_window_opaque_region_set(window,
|
ecore_wl2_window_opaque_region_set(window,
|
||||||
window->opaque.x,
|
window->opaque.x,
|
||||||
|
@ -1568,18 +1565,15 @@ ecore_wl2_window_commit(Ecore_Wl2_Window *window, Eina_Bool flush)
|
||||||
/* Dispatch any state we've been saving along the way */
|
/* Dispatch any state we've been saving along the way */
|
||||||
if (window->pending.geom)
|
if (window->pending.geom)
|
||||||
{
|
{
|
||||||
|
int gx, gy, gw, gh;
|
||||||
|
|
||||||
|
ecore_wl2_window_geometry_get(window, &gx, &gy, &gw, &gh);
|
||||||
if (window->xdg_toplevel)
|
if (window->xdg_toplevel)
|
||||||
xdg_surface_set_window_geometry(window->xdg_surface,
|
xdg_surface_set_window_geometry(window->xdg_surface,
|
||||||
window->set_config.geometry.x,
|
gx, gy, gw, gh);
|
||||||
window->set_config.geometry.y,
|
|
||||||
window->set_config.geometry.w,
|
|
||||||
window->set_config.geometry.h);
|
|
||||||
if (window->zxdg_surface)
|
if (window->zxdg_surface)
|
||||||
zxdg_surface_v6_set_window_geometry(window->zxdg_surface,
|
zxdg_surface_v6_set_window_geometry(window->zxdg_surface,
|
||||||
window->set_config.geometry.x,
|
gx, gy, gw, gh);
|
||||||
window->set_config.geometry.y,
|
|
||||||
window->set_config.geometry.w,
|
|
||||||
window->set_config.geometry.h);
|
|
||||||
}
|
}
|
||||||
if (window->pending.opaque || window->pending.input)
|
if (window->pending.opaque || window->pending.input)
|
||||||
_regions_set(window);
|
_regions_set(window);
|
||||||
|
|
|
@ -107,16 +107,16 @@ static void
|
||||||
_window_v6_popup_create(Ecore_Wl2_Window *win)
|
_window_v6_popup_create(Ecore_Wl2_Window *win)
|
||||||
{
|
{
|
||||||
struct zxdg_positioner_v6 *pos;
|
struct zxdg_positioner_v6 *pos;
|
||||||
|
int wx, wy, ww, wh;
|
||||||
|
|
||||||
EINA_SAFETY_ON_NULL_RETURN(win->parent);
|
EINA_SAFETY_ON_NULL_RETURN(win->parent);
|
||||||
pos = zxdg_shell_v6_create_positioner(win->display->wl.zxdg_shell);
|
pos = zxdg_shell_v6_create_positioner(win->display->wl.zxdg_shell);
|
||||||
if (!pos) return;
|
if (!pos) return;
|
||||||
|
|
||||||
zxdg_positioner_v6_set_anchor_rect(pos, win->set_config.geometry.x,
|
ecore_wl2_window_geometry_get(win, &wx, &wy, &ww, &wh);
|
||||||
win->set_config.geometry.y,
|
|
||||||
1, 1);
|
zxdg_positioner_v6_set_anchor_rect(pos, wx, wy, 1, 1);
|
||||||
zxdg_positioner_v6_set_size(pos, win->set_config.geometry.w,
|
zxdg_positioner_v6_set_size(pos, ww, wh);
|
||||||
win->set_config.geometry.h);
|
|
||||||
zxdg_positioner_v6_set_anchor(pos, ZXDG_POSITIONER_V6_ANCHOR_TOP |
|
zxdg_positioner_v6_set_anchor(pos, ZXDG_POSITIONER_V6_ANCHOR_TOP |
|
||||||
ZXDG_POSITIONER_V6_ANCHOR_LEFT);
|
ZXDG_POSITIONER_V6_ANCHOR_LEFT);
|
||||||
zxdg_positioner_v6_set_gravity(pos, ZXDG_POSITIONER_V6_ANCHOR_BOTTOM |
|
zxdg_positioner_v6_set_gravity(pos, ZXDG_POSITIONER_V6_ANCHOR_BOTTOM |
|
||||||
|
|
Loading…
Reference in New Issue