ecore_wl2: Fix anchor for xdg pop-ups

Anchors are in window geometry, so we should be using 0,0 instead
of the parent x,y for the top left corner of the window.

Signed-off-by: Derek Foreman <derek.foreman.samsung@gmail.com>
Reviewed-by: Chris Michael <cp.michael@samsung.com>
Differential Revision: https://phab.enlightenment.org/D7436
This commit is contained in:
Derek Foreman 2018-12-06 09:54:10 -06:00
parent 12af5537c5
commit c90826f72c
2 changed files with 6 additions and 6 deletions

View File

@ -304,15 +304,15 @@ static const struct xdg_popup_listener _xdg_popup_listener =
static void
_ecore_wl2_window_xdg_popup_create(Ecore_Wl2_Window *win)
{
int gx, gy, gw, gh;
int gw, gh;
struct xdg_positioner *pos;
EINA_SAFETY_ON_NULL_RETURN(win->parent);
pos = xdg_wm_base_create_positioner(win->display->wl.xdg_wm_base);
if (!pos) return;
ecore_wl2_window_geometry_get(win, &gx, &gy, &gw, &gh);
xdg_positioner_set_anchor_rect(pos, gx, gy, 1, 1);
ecore_wl2_window_geometry_get(win, NULL, NULL, &gw, &gh);
xdg_positioner_set_anchor_rect(pos, 0, 0, 1, 1);
xdg_positioner_set_size(pos, gw, gh);
xdg_positioner_set_anchor(pos, XDG_POSITIONER_ANCHOR_TOP_LEFT);
xdg_positioner_set_gravity(pos, ZXDG_POSITIONER_V6_ANCHOR_BOTTOM |

View File

@ -107,15 +107,15 @@ static void
_window_v6_popup_create(Ecore_Wl2_Window *win)
{
struct zxdg_positioner_v6 *pos;
int wx, wy, ww, wh;
int ww, wh;
EINA_SAFETY_ON_NULL_RETURN(win->parent);
pos = zxdg_shell_v6_create_positioner(win->display->wl.zxdg_shell);
if (!pos) return;
ecore_wl2_window_geometry_get(win, &wx, &wy, &ww, &wh);
ecore_wl2_window_geometry_get(win, NULL, NULL, &ww, &wh);
zxdg_positioner_v6_set_anchor_rect(pos, wx, wy, 1, 1);
zxdg_positioner_v6_set_anchor_rect(pos, 0, 0, 1, 1);
zxdg_positioner_v6_set_size(pos, ww, wh);
zxdg_positioner_v6_set_anchor(pos, ZXDG_POSITIONER_V6_ANCHOR_TOP |
ZXDG_POSITIONER_V6_ANCHOR_LEFT);