diff options
author | Ferdinand Schober <ferdinand.schober@fau.de> | 2022-09-19 23:20:02 +0200 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2022-10-09 10:07:51 +0200 |
commit | d5659948f1105b99d08542de7c370ba908b8cec8 (patch) | |
tree | 46c7f81e6d3c657d411fbfdff060722956b35147 /sway/input/seat.c | |
parent | Improve Japanese translation (diff) | |
download | sway-d5659948f1105b99d08542de7c370ba908b8cec8.tar.gz sway-d5659948f1105b99d08542de7c370ba908b8cec8.tar.zst sway-d5659948f1105b99d08542de7c370ba908b8cec8.zip |
allow pointer_constraints on layer_shell surfaces
Diffstat (limited to 'sway/input/seat.c')
-rw-r--r-- | sway/input/seat.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/sway/input/seat.c b/sway/input/seat.c index b21e1b86..6abb54e8 100644 --- a/sway/input/seat.c +++ b/sway/input/seat.c | |||
@@ -1462,6 +1462,18 @@ 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 sway_seat_node *current = wl_container_of(seat->focus_stack.next, current, link); | ||
1471 | struct wlr_layer_surface_v1 *layer = current->seat->focused_layer; | ||
1472 | if (layer && layer->surface) | ||
1473 | return layer->surface; | ||
1474 | return NULL; | ||
1475 | } | ||
1476 | |||
1465 | struct sway_workspace *seat_get_focused_workspace(struct sway_seat *seat) { | 1477 | struct sway_workspace *seat_get_focused_workspace(struct sway_seat *seat) { |
1466 | struct sway_node *focus = seat_get_focus_inactive(seat, &root->node); | 1478 | struct sway_node *focus = seat_get_focus_inactive(seat, &root->node); |
1467 | if (!focus) { | 1479 | if (!focus) { |