Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lock: fix swaylock cursor remaining visible #8343

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Luminiscental
Copy link

Fixes #8342 by listening to surface commit rather than surface map for focus and cursor rebasing on session lock.

@kennylevinsen
Copy link
Member

Hmm, this will cause the cursor to be rebased on every single surface commit - for an animated lockscreen (e.g., hyprlock), that will be on every animated frame. That seems too aggressive.

@Nefsen402
Copy link
Member

It just rebases the cursor which should be nearly free.

@kennylevinsen
Copy link
Member

It just rebases the cursor which should be nearly free.

static void handle_rebase(struct sway_seat *seat, uint32_t time_msec) {
	struct seatop_default_event *e = seat->seatop_data;
	struct sway_cursor *cursor = seat->cursor;
	struct wlr_surface *surface = NULL;
	double sx = 0.0, sy = 0.0;
	e->previous_node = node_at_coords(seat,
			cursor->cursor->x, cursor->cursor->y, &surface, &sx, &sy);

	if (surface) {
		if (seat_is_input_allowed(seat, surface)) {
			wlr_seat_pointer_notify_enter(seat->wlr_seat, surface, sx, sy);
			wlr_seat_pointer_notify_motion(seat->wlr_seat, time_msec, sx, sy);
		}
	} else {
		cursor_update_image(cursor, e->previous_node);
		wlr_seat_pointer_notify_clear_focus(seat->wlr_seat);
	}
}

It sends pointer events, as it was only meant to be called when focus changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Swaylock receives no pointer enter until cursor motion
3 participants