diff options
author | zccrs <zccrs@live.com> | 2021-06-01 19:42:25 +0800 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2021-06-03 09:50:54 +0200 |
commit | 11040d4942ed9210fcbca1d2d1001cb8d307b89d (patch) | |
tree | 2a642f3bcef33bd4b0d03d6af815ac84393d0ae2 | |
parent | 76f51a949f55c865e3ea1c90965afd4d835baad9 (diff) |
Make the xdg_popup_get_position to public
Rename the xdg_popup_get_position to
wlr_xdg_popup_get_position
-rw-r--r-- | include/wlr/types/wlr_xdg_shell.h | 5 | ||||
-rw-r--r-- | types/xdg_shell/wlr_xdg_surface.c | 6 |
2 files changed, 8 insertions, 3 deletions
diff --git a/include/wlr/types/wlr_xdg_shell.h b/include/wlr/types/wlr_xdg_shell.h index ec715bf4..856648f9 100644 --- a/include/wlr/types/wlr_xdg_shell.h +++ b/include/wlr/types/wlr_xdg_shell.h @@ -321,6 +321,11 @@ void wlr_xdg_toplevel_set_parent(struct wlr_xdg_surface *surface, void wlr_xdg_popup_destroy(struct wlr_xdg_surface *surface); /** + * Get the position for this popup in the surface parent's coordinate system. + */ +void wlr_xdg_popup_get_position(struct wlr_xdg_popup *popup, + double *popup_sx, double *popup_sy); +/** * Get the geometry for this positioner based on the anchor rect, gravity, and * size of this positioner. */ diff --git a/types/xdg_shell/wlr_xdg_surface.c b/types/xdg_shell/wlr_xdg_surface.c index edf562ab..0f85ac2d 100644 --- a/types/xdg_shell/wlr_xdg_surface.c +++ b/types/xdg_shell/wlr_xdg_surface.c @@ -568,7 +568,7 @@ void wlr_xdg_popup_destroy(struct wlr_xdg_surface *surface) { reset_xdg_surface(surface); } -static void xdg_popup_get_position(struct wlr_xdg_popup *popup, +void wlr_xdg_popup_get_position(struct wlr_xdg_popup *popup, double *popup_sx, double *popup_sy) { struct wlr_xdg_surface *parent = wlr_xdg_surface_from_wlr_surface(popup->parent); @@ -599,7 +599,7 @@ struct wlr_surface *wlr_xdg_surface_popup_surface_at( struct wlr_xdg_surface *popup = popup_state->base; double popup_sx, popup_sy; - xdg_popup_get_position(popup_state, &popup_sx, &popup_sy); + wlr_xdg_popup_get_position(popup_state, &popup_sx, &popup_sy); struct wlr_surface *sub = wlr_xdg_surface_surface_at(popup, sx - popup_sx, @@ -636,7 +636,7 @@ static void xdg_surface_for_each_popup_surface(struct wlr_xdg_surface *surface, } double popup_sx, popup_sy; - xdg_popup_get_position(popup_state, &popup_sx, &popup_sy); + wlr_xdg_popup_get_position(popup_state, &popup_sx, &popup_sy); struct xdg_surface_iterator_data data = { .user_iterator = iterator, |