aboutsummaryrefslogtreecommitdiff
path: root/sway/input
diff options
context:
space:
mode:
authoremersion <contact@emersion.fr>2018-05-21 11:24:05 +0100
committerGitHub <noreply@github.com>2018-05-21 11:24:05 +0100
commita7adbf4b79dce4d61de1a8a71cba535aeae6bc76 (patch)
tree68210775c09209884b46b5866ca1b4530ca24324 /sway/input
parentec1c4c6c3683772637dbfeaf5cdbaea4e1c6e49d (diff)
parent048b29527b8b0ec9c6cd9d0439b74bf73f4f6e2d (diff)
Merge pull request #2005 from RyanDwyer/tabbed-layout
Implement tabbed layout
Diffstat (limited to 'sway/input')
-rw-r--r--sway/input/cursor.c2
-rw-r--r--sway/input/seat.c12
2 files changed, 13 insertions, 1 deletions
diff --git a/sway/input/cursor.c b/sway/input/cursor.c
index b0ce8002..e0b987d2 100644
--- a/sway/input/cursor.c
+++ b/sway/input/cursor.c
@@ -108,7 +108,7 @@ static struct sway_container *container_at_coords(
}
struct sway_container *c;
- if ((c = container_at(ws, x, y, surface, sx, sy))) {
+ if ((c = container_at(ws, ox, oy, surface, sx, sy))) {
return c;
}
diff --git a/sway/input/seat.c b/sway/input/seat.c
index 7d541f6e..7a3e928a 100644
--- a/sway/input/seat.c
+++ b/sway/input/seat.c
@@ -718,6 +718,18 @@ struct sway_container *seat_get_focus_inactive(struct sway_seat *seat,
return seat_get_focus_by_type(seat, container, C_TYPES);
}
+struct sway_container *seat_get_active_child(struct sway_seat *seat,
+ struct sway_container *container) {
+ struct sway_container *focus = seat_get_focus_inactive(seat, container);
+ if (!focus) {
+ return NULL;
+ }
+ while (focus->parent != container) {
+ focus = focus->parent;
+ }
+ return focus;
+}
+
struct sway_container *sway_seat_get_focus(struct sway_seat *seat) {
if (!seat->has_focus) {
return NULL;