return;
}
+ /*
+ * Omit cursor notifications when the current cursor is
+ * invisible, e.g. on touch input.
+ */
+ if (!seat->cursor_visible) {
+ return;
+ }
+
/*
* Omit cursor notifications from a pointer when a tablet
* tool (stylus/pen) is in proximity. We expect to get cursor
return;
}
+ /*
+ * Omit set shape when the current cursor is
+ * invisible, e.g. on touch input.
+ */
+ if (!seat->cursor_visible) {
+ return;
+ }
+
/*
* This can be sent by any client, so we check to make sure this one
* actually has pointer focus first.
return;
}
- wlr_cursor_set_xcursor(seat->cursor, seat->xcursor_manager,
- cursor_names[cursor]);
+ if (seat->cursor_visible) {
+ wlr_cursor_set_xcursor(seat->cursor, seat->xcursor_manager,
+ cursor_names[cursor]);
+ }
seat->server_cursor = cursor;
}
+void
+cursor_set_visible(struct seat *seat, bool visible)
+{
+ if (seat->cursor_visible == visible) {
+ return;
+ }
+
+ seat->cursor_visible = visible;
+ cursor_update_image(seat);
+}
+
void
cursor_update_image(struct seat *seat)
{
enum lab_cursors cursor = seat->server_cursor;
+
+ if (!seat->cursor_visible) {
+ wlr_cursor_unset_image(seat->cursor);
+ return;
+ }
+
if (cursor == LAB_CURSOR_CLIENT) {
/*
* When we loose the output cursor while over a client
struct server *server = seat->server;
struct wlr_pointer_motion_event *event = data;
idle_manager_notify_activity(seat->seat);
+ cursor_set_visible(seat, /* visible */ true);
wlr_relative_pointer_manager_v1_send_relative_motion(
server->relative_pointer_manager,
listener, seat, cursor_motion_absolute);
struct wlr_pointer_motion_absolute_event *event = data;
idle_manager_notify_activity(seat->seat);
+ cursor_set_visible(seat, /* visible */ true);
double lx, ly;
wlr_cursor_absolute_to_layout_coords(seat->cursor,
struct seat *seat = wl_container_of(listener, seat, cursor_button);
struct wlr_pointer_button_event *event = data;
idle_manager_notify_activity(seat->seat);
+ cursor_set_visible(seat, /* visible */ true);
bool notify;
switch (event->state) {
struct cursor_context ctx = get_cursor_context(server);
idle_manager_notify_activity(seat->seat);
+ cursor_set_visible(seat, /* visible */ true);
/* Bindings swallow mouse events if activated */
bool handled = handle_cursor_axis(server, &ctx, event);
}
idle_manager_notify_activity(tablet->seat->seat);
+ cursor_set_visible(tablet->seat, /* visible */ true);
if (ev->state == WLR_TABLET_TOOL_PROXIMITY_IN) {
tablet->motion_mode =
}
idle_manager_notify_activity(tablet->seat->seat);
+ cursor_set_visible(tablet->seat, /* visible */ true);
/*
* Reset relative coordinates. If those axes aren't updated,
}
idle_manager_notify_activity(tablet->seat->seat);
+ cursor_set_visible(tablet->seat, /* visible */ true);
double x, y, dx, dy;
struct wlr_surface *surface = tablet_get_coords(tablet, &x, &y, &dx, &dy);
}
idle_manager_notify_activity(tablet->seat->seat);
+ cursor_set_visible(tablet->seat, /* visible */ true);
double x, y, dx, dy;
struct wlr_surface *surface = tablet_get_coords(tablet, &x, &y, &dx, &dy);