void tablet_tool_init(struct seat *seat,
struct wlr_tablet_tool *wlr_tablet_tool);
+bool tablet_tool_has_focused_surface(struct seat *seat);
#endif /* LABWC_TABLET_TOOL_H */
#include "input/gestures.h"
#include "input/touch.h"
#include "input/tablet-tool.h"
+#include "input/tablet-pad.h"
#include "labwc.h"
#include "layers.h"
#include "menu/menu.h"
* 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;
- }
+ if (tablet_tool_has_focused_surface(seat)) {
+ return;
}
/*
#include "input/tablet-tool.h"
#include "labwc.h"
+bool
+tablet_tool_has_focused_surface(struct seat *seat)
+{
+ struct drawing_tablet_tool *tool;
+ wl_list_for_each(tool, &seat->tablet_tools, link) {
+ if (tool->tool_v2->focused_surface) {
+ return true;
+ }
+ }
+
+ return false;
+}
+
static void
handle_set_cursor(struct wl_listener *listener, void *data)
{