Skip to content

Commit

Permalink
Fix cursor events on screen lock/unlock
Browse files Browse the repository at this point in the history
After the scene graph refactor, node_at_coords no longer return the
lock surface after the screen is locked, thereby cursor_rebase_all in
handle_surface_map won't work.

This commit make node_at_coords return lock surface when locked.

I also found that the cursor would disappear after screen is unlocked,
thereby adding a cursor_rebase_all in handle_unlock.
  • Loading branch information
ookami committed Oct 6, 2024
1 parent c90cb37 commit 8ae2b1b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions sway/input/cursor.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@ struct sway_node *node_at_coords(
}
}

if (server.session_lock.lock) {
*surface = server.session_lock.lock->focused;
return NULL;
}

if (scene_node) {
// determine what wlr_surface we clicked on
if (scene_node->type == WLR_SCENE_NODE_BUFFER) {
Expand Down
1 change: 1 addition & 0 deletions sway/lock.c
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ static void handle_unlock(struct wl_listener *listener, void *data) {
struct sway_output *output = root->outputs->items[i];
arrange_layers(output);
}
cursor_rebase_all();
}

static void handle_abandon(struct wl_listener *listener, void *data) {
Expand Down

0 comments on commit 8ae2b1b

Please sign in to comment.