wayland: account for CSD geometry offset in pointer hit testing
wlr_xdg_surface_surface_at expects surface-local coordinates (including the shadow region). Add geometry.x/y back when converting from screen coords to surface-local so the hit test aligns with the actual content.
This commit is contained in:
parent
d7b2c70c7c
commit
bc0446aa7a
|
|
@ -95,8 +95,9 @@ view_surface_at(int px, int py, double *sx_out, double *sy_out,
|
|||
return v->xw_surface->surface;
|
||||
}
|
||||
if (v->xdg_surface) {
|
||||
double sx = px - (double)v->x;
|
||||
double sy = py - (double)v->y;
|
||||
struct wlr_box geo = v->xdg_surface->geometry;
|
||||
double sx = px - (double)v->x + geo.x;
|
||||
double sy = py - (double)v->y + geo.y;
|
||||
double sub_sx, sub_sy;
|
||||
struct wlr_surface *sub = wlr_xdg_surface_surface_at(
|
||||
v->xdg_surface, sx, sy, &sub_sx, &sub_sy);
|
||||
|
|
|
|||
Loading…
Reference in New Issue