aboutsummaryrefslogtreecommitdiff
path: root/sway/input
diff options
context:
space:
mode:
Diffstat (limited to 'sway/input')
-rw-r--r--sway/input/cursor.c15
-rw-r--r--sway/input/input-manager.c1
-rw-r--r--sway/input/seat.c6
3 files changed, 13 insertions, 9 deletions
diff --git a/sway/input/cursor.c b/sway/input/cursor.c
index 3942b64f..c539df40 100644
--- a/sway/input/cursor.c
+++ b/sway/input/cursor.c
@@ -187,23 +187,22 @@ static enum wlr_edges find_edge(struct sway_container *cont,
if (!cont->view) {
return WLR_EDGE_NONE;
}
- struct sway_view *view = cont->view;
- if (view->border == B_NONE || !view->border_thickness ||
- view->border == B_CSD) {
+ if (cont->border == B_NONE || !cont->border_thickness ||
+ cont->border == B_CSD) {
return WLR_EDGE_NONE;
}
enum wlr_edges edge = 0;
- if (cursor->cursor->x < cont->x + view->border_thickness) {
+ if (cursor->cursor->x < cont->x + cont->border_thickness) {
edge |= WLR_EDGE_LEFT;
}
- if (cursor->cursor->y < cont->y + view->border_thickness) {
+ if (cursor->cursor->y < cont->y + cont->border_thickness) {
edge |= WLR_EDGE_TOP;
}
- if (cursor->cursor->x >= cont->x + cont->width - view->border_thickness) {
+ if (cursor->cursor->x >= cont->x + cont->width - cont->border_thickness) {
edge |= WLR_EDGE_RIGHT;
}
- if (cursor->cursor->y >= cont->y + cont->height - view->border_thickness) {
+ if (cursor->cursor->y >= cont->y + cont->height - cont->border_thickness) {
edge |= WLR_EDGE_BOTTOM;
}
@@ -585,7 +584,7 @@ static void cursor_do_rebase(struct sway_cursor *cursor, uint32_t time_msec,
void cursor_rebase(struct sway_cursor *cursor) {
uint32_t time_msec = get_current_time_msec();
- struct wlr_surface *surface;
+ struct wlr_surface *surface = NULL;
double sx, sy;
cursor->previous.node = node_at_coords(cursor->seat,
cursor->cursor->x, cursor->cursor->y, &surface, &sx, &sy);
diff --git a/sway/input/input-manager.c b/sway/input/input-manager.c
index 91c45dd1..68445d68 100644
--- a/sway/input/input-manager.c
+++ b/sway/input/input-manager.c
@@ -431,6 +431,7 @@ void input_manager_set_focus(struct sway_node *node) {
struct sway_seat *seat;
wl_list_for_each(seat, &server.input->seats, link) {
seat_set_focus(seat, node);
+ seat_consider_warp_to_focus(seat);
}
}
diff --git a/sway/input/seat.c b/sway/input/seat.c
index 577619a7..64419afa 100644
--- a/sway/input/seat.c
+++ b/sway/input/seat.c
@@ -185,7 +185,11 @@ static void handle_seat_node_destroy(struct wl_listener *listener, void *data) {
seat_set_focus(seat, next_focus);
} else {
// Setting focus_inactive
+ focus = seat_get_focus_inactive(seat, &root->node);
seat_set_raw_focus(seat, next_focus);
+ if (focus->type == N_CONTAINER) {
+ seat_set_raw_focus(seat, &focus->sway_container->workspace->node);
+ }
seat_set_raw_focus(seat, focus);
}
}
@@ -944,7 +948,7 @@ struct sway_node *seat_get_focus(struct sway_seat *seat) {
if (!seat->has_focus) {
return NULL;
}
- if (wl_list_length(&seat->focus_stack) == 0) {
+ if (wl_list_empty(&seat->focus_stack)) {
return NULL;
}
struct sway_seat_node *current =