mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2025-11-13 13:29:47 -05:00
Force pointer to stay on screen.
Without this change it's really easy to accidentally send the pointer flying and not be able to get it back.
This commit is contained in:
parent
2d4219e542
commit
90e701df08
1 changed files with 10 additions and 0 deletions
|
|
@ -724,9 +724,19 @@ void
|
|||
notify_motion(struct egl_input_device *device, int x, int y)
|
||||
{
|
||||
struct egl_surface *es;
|
||||
struct egl_compositor *ec = device->ec;
|
||||
const int hotspot_x = 16, hotspot_y = 16;
|
||||
int32_t sx, sy;
|
||||
|
||||
if (x < 0)
|
||||
x = 0;
|
||||
if (y < 0)
|
||||
y = 0;
|
||||
if (x >= ec->width)
|
||||
x = ec->width - 1;
|
||||
if (y >= ec->height)
|
||||
y = ec->height - 1;
|
||||
|
||||
es = pick_surface(device);
|
||||
|
||||
if (es) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue