Merge pull request #1105 from RyanDwyer/xdg-surface-for-each-popup
Introduce wlr_xdg_surface_for_each_popup
This commit is contained in:
commit
27cab67b96
|
@ -352,11 +352,19 @@ struct wlr_xdg_surface *wlr_xdg_surface_from_wlr_surface(
|
|||
void wlr_xdg_surface_get_geometry(struct wlr_xdg_surface *surface, struct wlr_box *box);
|
||||
|
||||
/**
|
||||
* Call `iterator` on each surface in the xdg-surface tree, with the surface's
|
||||
* position relative to the root xdg-surface. The function is called from root to
|
||||
* leaves (in rendering order).
|
||||
* Call `iterator` on each surface and popup in the xdg-surface tree, with the
|
||||
* surface's position relative to the root xdg-surface. The function is called
|
||||
* from root to leaves (in rendering order).
|
||||
*/
|
||||
void wlr_xdg_surface_for_each_surface(struct wlr_xdg_surface *surface,
|
||||
wlr_surface_iterator_func_t iterator, void *user_data);
|
||||
|
||||
/**
|
||||
* Call `iterator` on each popup in the xdg-surface tree, with the popup's
|
||||
* position relative to the root xdg-surface. The function is called from root
|
||||
* to leaves (in rendering order).
|
||||
*/
|
||||
void wlr_xdg_surface_for_each_popup(struct wlr_xdg_surface *surface,
|
||||
wlr_surface_iterator_func_t iterator, void *user_data);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -329,11 +329,19 @@ struct wlr_xdg_surface_v6 *wlr_xdg_surface_v6_from_wlr_surface(
|
|||
void wlr_xdg_surface_v6_get_geometry(struct wlr_xdg_surface_v6 *surface, struct wlr_box *box);
|
||||
|
||||
/**
|
||||
* Call `iterator` on each surface in the xdg-surface tree, with the surface's
|
||||
* position relative to the root xdg-surface. The function is called from root to
|
||||
* leaves (in rendering order).
|
||||
* Call `iterator` on each surface and popup in the xdg-surface tree, with the
|
||||
* surface's position relative to the root xdg-surface. The function is called
|
||||
* from root to leaves (in rendering order).
|
||||
*/
|
||||
void wlr_xdg_surface_v6_for_each_surface(struct wlr_xdg_surface_v6 *surface,
|
||||
wlr_surface_iterator_func_t iterator, void *user_data);
|
||||
|
||||
/**
|
||||
* Call `iterator` on each popup in the xdg-surface tree, with the popup's
|
||||
* position relative to the root xdg-surface. The function is called from root
|
||||
* to leaves (in rendering order).
|
||||
*/
|
||||
void wlr_xdg_surface_v6_for_each_popup(struct wlr_xdg_surface_v6 *surface,
|
||||
wlr_surface_iterator_func_t iterator, void *user_data);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -557,11 +557,36 @@ static void xdg_surface_for_each_surface(struct wlr_xdg_surface *surface,
|
|||
}
|
||||
}
|
||||
|
||||
static void xdg_surface_for_each_popup(struct wlr_xdg_surface *surface,
|
||||
int x, int y, wlr_surface_iterator_func_t iterator, void *user_data) {
|
||||
struct wlr_xdg_popup *popup_state;
|
||||
wl_list_for_each(popup_state, &surface->popups, link) {
|
||||
struct wlr_xdg_surface *popup = popup_state->base;
|
||||
if (!popup->configured) {
|
||||
continue;
|
||||
}
|
||||
|
||||
double popup_sx, popup_sy;
|
||||
xdg_popup_get_position(popup_state, &popup_sx, &popup_sy);
|
||||
iterator(popup->surface, x + popup_sx, y + popup_sy, user_data);
|
||||
|
||||
xdg_surface_for_each_popup(popup,
|
||||
x + popup_sx,
|
||||
y + popup_sy,
|
||||
iterator, user_data);
|
||||
}
|
||||
}
|
||||
|
||||
void wlr_xdg_surface_for_each_surface(struct wlr_xdg_surface *surface,
|
||||
wlr_surface_iterator_func_t iterator, void *user_data) {
|
||||
xdg_surface_for_each_surface(surface, 0, 0, iterator, user_data);
|
||||
}
|
||||
|
||||
void wlr_xdg_surface_for_each_popup(struct wlr_xdg_surface *surface,
|
||||
wlr_surface_iterator_func_t iterator, void *user_data) {
|
||||
xdg_surface_for_each_popup(surface, 0, 0, iterator, user_data);
|
||||
}
|
||||
|
||||
void wlr_xdg_surface_get_geometry(struct wlr_xdg_surface *surface, struct wlr_box *box) {
|
||||
wlr_surface_get_extends(surface->surface, box);
|
||||
/* The client never set the geometry */
|
||||
|
|
|
@ -536,11 +536,36 @@ static void xdg_surface_v6_for_each_surface(struct wlr_xdg_surface_v6 *surface,
|
|||
}
|
||||
}
|
||||
|
||||
static void xdg_surface_v6_for_each_popup(struct wlr_xdg_surface_v6 *surface,
|
||||
int x, int y, wlr_surface_iterator_func_t iterator, void *user_data) {
|
||||
struct wlr_xdg_popup_v6 *popup_state;
|
||||
wl_list_for_each(popup_state, &surface->popups, link) {
|
||||
struct wlr_xdg_surface_v6 *popup = popup_state->base;
|
||||
if (!popup->configured) {
|
||||
continue;
|
||||
}
|
||||
|
||||
double popup_sx, popup_sy;
|
||||
xdg_popup_v6_get_position(popup_state, &popup_sx, &popup_sy);
|
||||
iterator(popup->surface, x + popup_sx, y + popup_sy, user_data);
|
||||
|
||||
xdg_surface_v6_for_each_popup(popup,
|
||||
x + popup_sx,
|
||||
y + popup_sy,
|
||||
iterator, user_data);
|
||||
}
|
||||
}
|
||||
|
||||
void wlr_xdg_surface_v6_for_each_surface(struct wlr_xdg_surface_v6 *surface,
|
||||
wlr_surface_iterator_func_t iterator, void *user_data) {
|
||||
xdg_surface_v6_for_each_surface(surface, 0, 0, iterator, user_data);
|
||||
}
|
||||
|
||||
void wlr_xdg_surface_v6_for_each_popup(struct wlr_xdg_surface_v6 *surface,
|
||||
wlr_surface_iterator_func_t iterator, void *user_data) {
|
||||
xdg_surface_v6_for_each_popup(surface, 0, 0, iterator, user_data);
|
||||
}
|
||||
|
||||
void wlr_xdg_surface_v6_get_geometry(struct wlr_xdg_surface_v6 *surface, struct wlr_box *box) {
|
||||
wlr_surface_get_extends(surface->surface, box);
|
||||
/* The client never set the geometry */
|
||||
|
|
Loading…
Reference in New Issue