mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-10-31 22:25:21 -04:00
Add wlr_xdg_surface_v6_surface_at and wlr_wl_shell_surface_surface_at
This commit is contained in:
parent
1a8b24bdd2
commit
c9d21106b4
5 changed files with 47 additions and 101 deletions
|
|
@ -577,37 +577,23 @@ static bool view_at(struct roots_view *view, double lx, double ly,
|
|||
view_sy = ry + (double)box.height/2;
|
||||
}
|
||||
|
||||
if (view->type == ROOTS_XDG_SHELL_V6_VIEW) {
|
||||
double popup_sx, popup_sy;
|
||||
struct wlr_xdg_surface_v6 *popup =
|
||||
wlr_xdg_surface_v6_popup_at(view->xdg_surface_v6,
|
||||
view_sx, view_sy, &popup_sx, &popup_sy);
|
||||
|
||||
if (popup) {
|
||||
*sx = view_sx - popup_sx;
|
||||
*sy = view_sy - popup_sy;
|
||||
*surface = popup->surface;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if (view->type == ROOTS_WL_SHELL_VIEW) {
|
||||
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 true;
|
||||
}
|
||||
}
|
||||
|
||||
double _sx, _sy;
|
||||
struct wlr_surface *_surface = wlr_surface_surface_at(view->wlr_surface,
|
||||
view_sx, view_sy, &_sx, &_sy);
|
||||
struct wlr_surface *_surface;
|
||||
switch (view->type) {
|
||||
case ROOTS_XDG_SHELL_V6_VIEW:
|
||||
_surface = wlr_xdg_surface_v6_surface_at(view->xdg_surface_v6,
|
||||
view_sx, view_sy, &_sx, &_sy);
|
||||
break;
|
||||
case ROOTS_WL_SHELL_VIEW:
|
||||
_surface = wlr_wl_shell_surface_surface_at(view->wl_shell_surface,
|
||||
view_sx, view_sy, &_sx, &_sy);
|
||||
break;
|
||||
case ROOTS_XWAYLAND_VIEW:
|
||||
case ROOTS_XDG_SHELL_VIEW: // TODO
|
||||
_surface = wlr_surface_surface_at(view->wlr_surface,
|
||||
view_sx, view_sy, &_sx, &_sy);
|
||||
break;
|
||||
}
|
||||
if (_surface != NULL) {
|
||||
*sx = _sx;
|
||||
*sy = _sy;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue