|
|
@ -103,6 +103,12 @@ struct roots_view *view_at(struct roots_desktop *desktop, double lx, double ly,
|
|
|
|
for (int i = desktop->views->length - 1; i >= 0; --i) {
|
|
|
|
for (int i = desktop->views->length - 1; i >= 0; --i) {
|
|
|
|
struct roots_view *view = desktop->views->items[i];
|
|
|
|
struct roots_view *view = desktop->views->items[i];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (view->type == ROOTS_WL_SHELL_VIEW &&
|
|
|
|
|
|
|
|
view->wl_shell_surface->state ==
|
|
|
|
|
|
|
|
WLR_WL_SHELL_SURFACE_STATE_POPUP) {
|
|
|
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
double view_sx = lx - view->x;
|
|
|
|
double view_sx = lx - view->x;
|
|
|
|
double view_sy = ly - view->y;
|
|
|
|
double view_sy = ly - view->y;
|
|
|
|
|
|
|
|
|
|
|
@ -138,6 +144,21 @@ struct roots_view *view_at(struct roots_desktop *desktop, double lx, double ly,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (view->type == ROOTS_WL_SHELL_VIEW) {
|
|
|
|
|
|
|
|
// TODO: test if this works with rotated views
|
|
|
|
|
|
|
|
double popup_sx, popup_sy;
|
|
|
|
|
|
|
|
struct wlr_wl_shell_surface *popup =
|
|
|
|
|
|
|
|
wlr_wl_shell_surface_popup_at(view->wl_shell_surface,
|
|
|
|
|
|
|
|
view_sx, view_sy, &popup_sx, &popup_sy);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (popup) {
|
|
|
|
|
|
|
|
*sx = view_sx - popup_sx;
|
|
|
|
|
|
|
|
*sy = view_sy - popup_sy;
|
|
|
|
|
|
|
|
*surface = popup->surface;
|
|
|
|
|
|
|
|
return view;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
double sub_x, sub_y;
|
|
|
|
double sub_x, sub_y;
|
|
|
|
struct wlr_subsurface *subsurface =
|
|
|
|
struct wlr_subsurface *subsurface =
|
|
|
|
wlr_surface_subsurface_at(view->wlr_surface,
|
|
|
|
wlr_surface_subsurface_at(view->wlr_surface,
|
|
|
|