aboutsummaryrefslogtreecommitdiffstats
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,
187 if (!cont->view) { 187 if (!cont->view) {
188 return WLR_EDGE_NONE; 188 return WLR_EDGE_NONE;
189 } 189 }
190 struct sway_view *view = cont->view; 190 if (cont->border == B_NONE || !cont->border_thickness ||
191 if (view->border == B_NONE || !view->border_thickness || 191 cont->border == B_CSD) {
192 view->border == B_CSD) {
193 return WLR_EDGE_NONE; 192 return WLR_EDGE_NONE;
194 } 193 }
195 194
196 enum wlr_edges edge = 0; 195 enum wlr_edges edge = 0;
197 if (cursor->cursor->x < cont->x + view->border_thickness) { 196 if (cursor->cursor->x < cont->x + cont->border_thickness) {
198 edge |= WLR_EDGE_LEFT; 197 edge |= WLR_EDGE_LEFT;
199 } 198 }
200 if (cursor->cursor->y < cont->y + view->border_thickness) { 199 if (cursor->cursor->y < cont->y + cont->border_thickness) {
201 edge |= WLR_EDGE_TOP; 200 edge |= WLR_EDGE_TOP;
202 } 201 }
203 if (cursor->cursor->x >= cont->x + cont->width - view->border_thickness) { 202 if (cursor->cursor->x >= cont->x + cont->width - cont->border_thickness) {
204 edge |= WLR_EDGE_RIGHT; 203 edge |= WLR_EDGE_RIGHT;
205 } 204 }
206 if (cursor->cursor->y >= cont->y + cont->height - view->border_thickness) { 205 if (cursor->cursor->y >= cont->y + cont->height - cont->border_thickness) {
207 edge |= WLR_EDGE_BOTTOM; 206 edge |= WLR_EDGE_BOTTOM;
208 } 207 }
209 208
@@ -585,7 +584,7 @@ static void cursor_do_rebase(struct sway_cursor *cursor, uint32_t time_msec,
585 584
586void cursor_rebase(struct sway_cursor *cursor) { 585void cursor_rebase(struct sway_cursor *cursor) {
587 uint32_t time_msec = get_current_time_msec(); 586 uint32_t time_msec = get_current_time_msec();
588 struct wlr_surface *surface; 587 struct wlr_surface *surface = NULL;
589 double sx, sy; 588 double sx, sy;
590 cursor->previous.node = node_at_coords(cursor->seat, 589 cursor->previous.node = node_at_coords(cursor->seat,
591 cursor->cursor->x, cursor->cursor->y, &surface, &sx, &sy); 590 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) {
431 struct sway_seat *seat; 431 struct sway_seat *seat;
432 wl_list_for_each(seat, &server.input->seats, link) { 432 wl_list_for_each(seat, &server.input->seats, link) {
433 seat_set_focus(seat, node); 433 seat_set_focus(seat, node);
434 seat_consider_warp_to_focus(seat);
434 } 435 }
435} 436}
436 437
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) {
185 seat_set_focus(seat, next_focus); 185 seat_set_focus(seat, next_focus);
186 } else { 186 } else {
187 // Setting focus_inactive 187 // Setting focus_inactive
188 focus = seat_get_focus_inactive(seat, &root->node);
188 seat_set_raw_focus(seat, next_focus); 189 seat_set_raw_focus(seat, next_focus);
190 if (focus->type == N_CONTAINER) {
191 seat_set_raw_focus(seat, &focus->sway_container->workspace->node);
192 }
189 seat_set_raw_focus(seat, focus); 193 seat_set_raw_focus(seat, focus);
190 } 194 }
191} 195}
@@ -944,7 +948,7 @@ struct sway_node *seat_get_focus(struct sway_seat *seat) {
944 if (!seat->has_focus) { 948 if (!seat->has_focus) {
945 return NULL; 949 return NULL;
946 } 950 }
947 if (wl_list_length(&seat->focus_stack) == 0) { 951 if (wl_list_empty(&seat->focus_stack)) {
948 return NULL; 952 return NULL;
949 } 953 }
950 struct sway_seat_node *current = 954 struct sway_seat_node *current =