diff options
author | Ryan Dwyer <ryandwyer1@gmail.com> | 2019-01-25 08:29:21 +1000 |
---|---|---|
committer | Ryan Dwyer <ryandwyer1@gmail.com> | 2019-01-25 08:29:21 +1000 |
commit | 20aa8ee67dc528299dbc8735220a1c081c7ff9f6 (patch) | |
tree | 685de48be3db51fc01510ccf051e2b63a4655fba /sway/input | |
parent | Update for swaywm/wlroots#1402 (diff) | |
download | sway-20aa8ee67dc528299dbc8735220a1c081c7ff9f6.tar.gz sway-20aa8ee67dc528299dbc8735220a1c081c7ff9f6.tar.zst sway-20aa8ee67dc528299dbc8735220a1c081c7ff9f6.zip |
Implement fullscreen global
Diffstat (limited to 'sway/input')
-rw-r--r-- | sway/input/cursor.c | 12 | ||||
-rw-r--r-- | sway/input/seat.c | 12 |
2 files changed, 23 insertions, 1 deletions
diff --git a/sway/input/cursor.c b/sway/input/cursor.c index bf9bf2da..4b2d99e6 100644 --- a/sway/input/cursor.c +++ b/sway/input/cursor.c | |||
@@ -90,6 +90,16 @@ struct sway_node *node_at_coords( | |||
90 | double ox = lx, oy = ly; | 90 | double ox = lx, oy = ly; |
91 | wlr_output_layout_output_coords(root->output_layout, wlr_output, &ox, &oy); | 91 | wlr_output_layout_output_coords(root->output_layout, wlr_output, &ox, &oy); |
92 | 92 | ||
93 | if (root->fullscreen_global) { | ||
94 | // Try fullscreen container | ||
95 | struct sway_container *con = tiling_container_at( | ||
96 | &root->fullscreen_global->node, lx, ly, surface, sx, sy); | ||
97 | if (con) { | ||
98 | return &con->node; | ||
99 | } | ||
100 | return NULL; | ||
101 | } | ||
102 | |||
93 | // find the focused workspace on the output for this seat | 103 | // find the focused workspace on the output for this seat |
94 | struct sway_workspace *ws = output_get_active_workspace(output); | 104 | struct sway_workspace *ws = output_get_active_workspace(output); |
95 | 105 | ||
@@ -659,7 +669,7 @@ void dispatch_cursor_button(struct sway_cursor *cursor, | |||
659 | // Handle moving a tiling container | 669 | // Handle moving a tiling container |
660 | if (config->tiling_drag && (mod_pressed || on_titlebar) && | 670 | if (config->tiling_drag && (mod_pressed || on_titlebar) && |
661 | state == WLR_BUTTON_PRESSED && !is_floating_or_child && | 671 | state == WLR_BUTTON_PRESSED && !is_floating_or_child && |
662 | cont && !cont->is_fullscreen) { | 672 | cont && cont->fullscreen_mode == FULLSCREEN_NONE) { |
663 | struct sway_container *focus = seat_get_focused_container(seat); | 673 | struct sway_container *focus = seat_get_focused_container(seat); |
664 | bool focused = focus == cont || container_has_ancestor(focus, cont); | 674 | bool focused = focus == cont || container_has_ancestor(focus, cont); |
665 | if (on_titlebar && !focused) { | 675 | if (on_titlebar && !focused) { |
diff --git a/sway/input/seat.c b/sway/input/seat.c index fd5eda2d..f216810b 100644 --- a/sway/input/seat.c +++ b/sway/input/seat.c | |||
@@ -753,6 +753,18 @@ void seat_set_focus(struct sway_seat *seat, struct sway_node *node) { | |||
753 | return; | 753 | return; |
754 | } | 754 | } |
755 | } | 755 | } |
756 | // Deny setting focus to a workspace node when using fullscreen global | ||
757 | if (root->fullscreen_global && !container && new_workspace) { | ||
758 | return; | ||
759 | } | ||
760 | // Deny setting focus to a view which is hidden by a fullscreen global | ||
761 | if (root->fullscreen_global && container != root->fullscreen_global && | ||
762 | !container_has_ancestor(container, root->fullscreen_global)) { | ||
763 | // Unless it's a transient container | ||
764 | if (!container_is_transient_for(container, root->fullscreen_global)) { | ||
765 | return; | ||
766 | } | ||
767 | } | ||
756 | 768 | ||
757 | struct sway_output *new_output = new_workspace->output; | 769 | struct sway_output *new_output = new_workspace->output; |
758 | 770 | ||