diff options
-rw-r--r-- | include/sway/input/seat.h | 2 | ||||
-rw-r--r-- | sway/input/cursor.c | 2 | ||||
-rw-r--r-- | sway/input/seat.c | 11 |
3 files changed, 1 insertions, 14 deletions
diff --git a/include/sway/input/seat.h b/include/sway/input/seat.h index e795ad5e..c2041742 100644 --- a/include/sway/input/seat.h +++ b/include/sway/input/seat.h | |||
@@ -192,8 +192,6 @@ void seat_set_exclusive_client(struct sway_seat *seat, | |||
192 | 192 | ||
193 | struct sway_node *seat_get_focus(struct sway_seat *seat); | 193 | struct sway_node *seat_get_focus(struct sway_seat *seat); |
194 | 194 | ||
195 | struct wlr_surface *seat_get_focused_surface(struct sway_seat *seat); | ||
196 | |||
197 | struct sway_workspace *seat_get_focused_workspace(struct sway_seat *seat); | 195 | struct sway_workspace *seat_get_focused_workspace(struct sway_seat *seat); |
198 | 196 | ||
199 | // If a scratchpad container is fullscreen global, this can be used to try to | 197 | // If a scratchpad container is fullscreen global, this can be used to try to |
diff --git a/sway/input/cursor.c b/sway/input/cursor.c index bf9c9b6b..449aa430 100644 --- a/sway/input/cursor.c +++ b/sway/input/cursor.c | |||
@@ -1372,7 +1372,7 @@ void handle_pointer_constraint(struct wl_listener *listener, void *data) { | |||
1372 | sway_constraint->destroy.notify = handle_constraint_destroy; | 1372 | sway_constraint->destroy.notify = handle_constraint_destroy; |
1373 | wl_signal_add(&constraint->events.destroy, &sway_constraint->destroy); | 1373 | wl_signal_add(&constraint->events.destroy, &sway_constraint->destroy); |
1374 | 1374 | ||
1375 | struct wlr_surface *surface = seat_get_focused_surface(seat); | 1375 | struct wlr_surface *surface = seat->wlr_seat->keyboard_state.focused_surface; |
1376 | if (surface && surface == constraint->surface) { | 1376 | if (surface && surface == constraint->surface) { |
1377 | sway_cursor_constrain(seat->cursor, constraint); | 1377 | sway_cursor_constrain(seat->cursor, constraint); |
1378 | } | 1378 | } |
diff --git a/sway/input/seat.c b/sway/input/seat.c index 5b5741d1..b21e1b86 100644 --- a/sway/input/seat.c +++ b/sway/input/seat.c | |||
@@ -1462,17 +1462,6 @@ struct sway_node *seat_get_focus(struct sway_seat *seat) { | |||
1462 | return current->node; | 1462 | return current->node; |
1463 | } | 1463 | } |
1464 | 1464 | ||
1465 | struct wlr_surface *seat_get_focused_surface(struct sway_seat *seat) { | ||
1466 | struct sway_node *focus = seat_get_focus(seat); | ||
1467 | if (focus && node_is_view(focus)) { | ||
1468 | return focus->sway_container->view->surface; | ||
1469 | } | ||
1470 | struct wlr_layer_surface_v1 *layer = seat->focused_layer; | ||
1471 | if (layer && layer->surface) | ||
1472 | return layer->surface; | ||
1473 | return NULL; | ||
1474 | } | ||
1475 | |||
1476 | struct sway_workspace *seat_get_focused_workspace(struct sway_seat *seat) { | 1465 | struct sway_workspace *seat_get_focused_workspace(struct sway_seat *seat) { |
1477 | struct sway_node *focus = seat_get_focus_inactive(seat, &root->node); | 1466 | struct sway_node *focus = seat_get_focus_inactive(seat, &root->node); |
1478 | if (!focus) { | 1467 | if (!focus) { |