diff options
author | Tony Crisci <tony@dubstepdish.com> | 2018-04-04 18:52:38 -0400 |
---|---|---|
committer | Tony Crisci <tony@dubstepdish.com> | 2018-04-04 18:52:38 -0400 |
commit | 3e61718053a7e2cdd94c64f5613c6bdf28e35c8e (patch) | |
tree | 4cceb8836dbc34317c8e530aec373fd6241db466 /sway/input | |
parent | Merge pull request #1731 from acrisci/ipc-window-events (diff) | |
download | sway-3e61718053a7e2cdd94c64f5613c6bdf28e35c8e.tar.gz sway-3e61718053a7e2cdd94c64f5613c6bdf28e35c8e.tar.zst sway-3e61718053a7e2cdd94c64f5613c6bdf28e35c8e.zip |
try to fix focus-inactive
Diffstat (limited to 'sway/input')
-rw-r--r-- | sway/input/seat.c | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/sway/input/seat.c b/sway/input/seat.c index 4a99e9eb..078cb8b8 100644 --- a/sway/input/seat.c +++ b/sway/input/seat.c | |||
@@ -467,22 +467,18 @@ struct sway_container *sway_seat_get_focus(struct sway_seat *seat) { | |||
467 | 467 | ||
468 | struct sway_container *seat_get_focus_by_type(struct sway_seat *seat, | 468 | struct sway_container *seat_get_focus_by_type(struct sway_seat *seat, |
469 | struct sway_container *container, enum sway_container_type type) { | 469 | struct sway_container *container, enum sway_container_type type) { |
470 | if (container->type == C_VIEW || container->children->length == 0) { | ||
471 | return container; | ||
472 | } | ||
473 | |||
470 | struct sway_seat_container *current = NULL; | 474 | struct sway_seat_container *current = NULL; |
471 | struct sway_container *parent = NULL; | ||
472 | wl_list_for_each(current, &seat->focus_stack, link) { | 475 | wl_list_for_each(current, &seat->focus_stack, link) { |
473 | parent = current->container->parent; | 476 | if (type != C_TYPES && container->type != type) { |
474 | 477 | continue; | |
475 | if (current->container == container && | ||
476 | (type == C_TYPES || container->type == type)) { | ||
477 | return current->container; | ||
478 | } | 478 | } |
479 | 479 | ||
480 | while (parent) { | 480 | if (container_has_child(container, current->container)) { |
481 | if (parent == container && (type == C_TYPES || | 481 | return current->container; |
482 | current->container->type == type)) { | ||
483 | return current->container; | ||
484 | } | ||
485 | parent = parent->parent; | ||
486 | } | 482 | } |
487 | } | 483 | } |
488 | 484 | ||