diff options
author | Ian Fan <ianfan0@gmail.com> | 2018-10-10 12:23:04 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-10 12:23:04 +0000 |
commit | cd6917d4a821fe904a2c242dff673967aa3ad4b2 (patch) | |
tree | e21f0b633212c6b8084348f08fc68cec2efece8b /sway/tree | |
parent | d3f0e52784712696c7174d3adf8ec6cf3ac31b19 (diff) | |
parent | 782ed19bc30378126f44272c1e46f2a05a9b2db1 (diff) |
Merge branch 'master' into bar-bindsym
Diffstat (limited to 'sway/tree')
-rw-r--r-- | sway/tree/container.c | 12 | ||||
-rw-r--r-- | sway/tree/view.c | 4 | ||||
-rw-r--r-- | sway/tree/workspace.c | 5 |
3 files changed, 10 insertions, 11 deletions
diff --git a/sway/tree/container.c b/sway/tree/container.c index 1664514a..f36fe4b0 100644 --- a/sway/tree/container.c +++ b/sway/tree/container.c @@ -358,7 +358,6 @@ struct sway_container *container_at(struct sway_workspace *workspace, struct wlr_surface **surface, double *sx, double *sy) { struct sway_container *c; - // Focused view's popups struct sway_seat *seat = input_manager_current_seat(input_manager); struct sway_container *focus = seat_get_focused_container(seat); bool is_floating = focus && container_is_floating_or_child(focus); @@ -370,14 +369,11 @@ struct sway_container *container_at(struct sway_workspace *workspace, } *surface = NULL; } - // Cast a ray to handle floating windows - for (int i = workspace->floating->length - 1; i >= 0; --i) { - struct sway_container *cn = workspace->floating->items[i]; - if (cn->view && (c = surface_at_view(cn, lx, ly, surface, sx, sy))) { - return c; - } + // Floating + if ((c = floating_container_at(lx, ly, surface ,sx ,sy))) { + return c; } - // If focused is tiling, focused view's non-popups + // Tiling (focused) if (focus && focus->view && !is_floating) { if ((c = surface_at_view(focus, lx, ly, surface, sx, sy))) { return c; diff --git a/sway/tree/view.c b/sway/tree/view.c index 1f00452d..e613ac0b 100644 --- a/sway/tree/view.c +++ b/sway/tree/view.c @@ -243,10 +243,10 @@ void view_autoconfigure(struct sway_view *view) { // title area. We have to offset the surface y by the height of the title, // bar, and disable any top border because we'll always have the title bar. enum sway_container_layout layout = container_parent_layout(con); - if (layout == L_TABBED) { + if (layout == L_TABBED && !container_is_floating(con)) { y_offset = container_titlebar_height(); view->border_top = false; - } else if (layout == L_STACKED) { + } else if (layout == L_STACKED && !container_is_floating(con)) { list_t *siblings = container_get_siblings(con); y_offset = container_titlebar_height() * siblings->length; view->border_top = false; diff --git a/sway/tree/workspace.c b/sway/tree/workspace.c index b357d83d..d7650560 100644 --- a/sway/tree/workspace.c +++ b/sway/tree/workspace.c @@ -624,7 +624,10 @@ void workspace_add_gaps(struct sway_workspace *ws) { if (config->smart_gaps) { struct sway_seat *seat = input_manager_get_default_seat(input_manager); struct sway_container *focus = - seat_get_focus_inactive_view(seat, &ws->node); + seat_get_focus_inactive_tiling(seat, ws); + if (focus && !focus->view) { + focus = seat_get_focus_inactive_view(seat, &focus->node); + } if (focus && focus->view && view_is_only_visible(focus->view)) { return; } |