input: prevent cursor notifications from pointer and tablet tool

... at the same time. Omit cursor notifications from
a pointer when a tablet tool (stylus/pen) is in
proximity. We expect to get cursor notifications
from the tablet tool instead.
This commit is contained in:
Jens Peters 2024-05-28 20:50:05 +02:00 committed by Consolatis
parent d00711bc45
commit 2388f37cc7
5 changed files with 24 additions and 0 deletions

View file

@ -17,6 +17,7 @@
#include "idle.h"
#include "input/gestures.h"
#include "input/touch.h"
#include "input/tablet-tool.h"
#include "labwc.h"
#include "layers.h"
#include "menu/menu.h"
@ -140,6 +141,22 @@ request_cursor_notify(struct wl_listener *listener, void *data)
return;
}
/*
* Omit cursor notifications from a pointer when a tablet
* tool (stylus/pen) is in proximity. We expect to get cursor
* notifications from the tablet tool instead.
* Receiving cursor notifications from pointer and tablet tool at
* the same time is a side effect of also setting pointer focus
* when a tablet tool enters proximity on a tablet-capable surface.
* See also `notify_motion()` in `input/tablet.c`.
*/
struct drawing_tablet_tool *tool;
wl_list_for_each(tool, &seat->tablet_tools, link) {
if (tool->tool_v2->focused_surface) {
return;
}
}
/*
* This event is raised by the seat when a client provides a cursor
* image