mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-23 05:15:58 +01:00
xdg-surface: minor consistency renaming
This commit is contained in:
parent
88f3040438
commit
fd3a2a0906
1 changed files with 14 additions and 19 deletions
|
@ -489,19 +489,17 @@ struct wlr_surface *wlr_xdg_surface_surface_at(
|
||||||
struct wlr_surface *wlr_xdg_surface_popup_surface_at(
|
struct wlr_surface *wlr_xdg_surface_popup_surface_at(
|
||||||
struct wlr_xdg_surface *surface, double sx, double sy,
|
struct wlr_xdg_surface *surface, double sx, double sy,
|
||||||
double *sub_x, double *sub_y) {
|
double *sub_x, double *sub_y) {
|
||||||
struct wlr_xdg_popup *popup_state;
|
struct wlr_xdg_popup *popup;
|
||||||
wl_list_for_each(popup_state, &surface->popups, link) {
|
wl_list_for_each(popup, &surface->popups, link) {
|
||||||
struct wlr_xdg_surface *popup = popup_state->base;
|
if (!popup->base->mapped) {
|
||||||
if (!popup->mapped) {
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
double popup_sx, popup_sy;
|
double popup_sx, popup_sy;
|
||||||
wlr_xdg_popup_get_position(popup_state, &popup_sx, &popup_sy);
|
wlr_xdg_popup_get_position(popup, &popup_sx, &popup_sy);
|
||||||
|
|
||||||
struct wlr_surface *sub = wlr_xdg_surface_surface_at(popup,
|
struct wlr_surface *sub = wlr_xdg_surface_surface_at(
|
||||||
sx - popup_sx,
|
popup->base, sx - popup_sx, sy - popup_sy,
|
||||||
sy - popup_sy,
|
|
||||||
sub_x, sub_y);
|
sub_x, sub_y);
|
||||||
if (sub != NULL) {
|
if (sub != NULL) {
|
||||||
return sub;
|
return sub;
|
||||||
|
@ -526,28 +524,25 @@ static void xdg_surface_iterator(struct wlr_surface *surface,
|
||||||
|
|
||||||
static void xdg_surface_for_each_popup_surface(struct wlr_xdg_surface *surface,
|
static void xdg_surface_for_each_popup_surface(struct wlr_xdg_surface *surface,
|
||||||
int x, int y, wlr_surface_iterator_func_t iterator, void *user_data) {
|
int x, int y, wlr_surface_iterator_func_t iterator, void *user_data) {
|
||||||
struct wlr_xdg_popup *popup_state;
|
struct wlr_xdg_popup *popup;
|
||||||
wl_list_for_each(popup_state, &surface->popups, link) {
|
wl_list_for_each(popup, &surface->popups, link) {
|
||||||
struct wlr_xdg_surface *popup = popup_state->base;
|
if (!popup->base->configured || !popup->base->mapped) {
|
||||||
if (!popup->configured || !popup->mapped) {
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
double popup_sx, popup_sy;
|
double popup_sx, popup_sy;
|
||||||
wlr_xdg_popup_get_position(popup_state, &popup_sx, &popup_sy);
|
wlr_xdg_popup_get_position(popup, &popup_sx, &popup_sy);
|
||||||
|
|
||||||
struct xdg_surface_iterator_data data = {
|
struct xdg_surface_iterator_data data = {
|
||||||
.user_iterator = iterator,
|
.user_iterator = iterator,
|
||||||
.user_data = user_data,
|
.user_data = user_data,
|
||||||
.x = x + popup_sx, .y = y + popup_sy,
|
.x = x + popup_sx, .y = y + popup_sy,
|
||||||
};
|
};
|
||||||
wlr_surface_for_each_surface(popup->surface, xdg_surface_iterator,
|
wlr_surface_for_each_surface(popup->base->surface,
|
||||||
&data);
|
xdg_surface_iterator, &data);
|
||||||
|
|
||||||
xdg_surface_for_each_popup_surface(popup,
|
xdg_surface_for_each_popup_surface(popup->base,
|
||||||
x + popup_sx,
|
x + popup_sx, y + popup_sy, iterator, user_data);
|
||||||
y + popup_sy,
|
|
||||||
iterator, user_data);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue