commit d0b9701820bd92e008e73693d5e61d672372e7e1
parent 14cab7861294189f820e0830ae84ac7b15271342
Author: emersion <contact@emersion.fr>
Date: Thu, 10 Jan 2019 00:32:09 +0100
Merge pull request #3396 from RedSoxFan/scroll-titlebar-border
cursor: allow scrolling tabs/stack on title border
Diffstat:
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/sway/input/cursor.c b/sway/input/cursor.c
@@ -1092,6 +1092,8 @@ static void dispatch_cursor_axis(struct sway_cursor *cursor,
enum wlr_edges edge = cont ? find_edge(cont, cursor) : WLR_EDGE_NONE;
bool on_border = edge != WLR_EDGE_NONE;
bool on_titlebar = cont && !on_border && !surface;
+ bool on_titlebar_border = cont && on_border &&
+ cursor->cursor->y < cont->content_y;
bool on_contents = cont && !on_border && surface;
float scroll_factor =
(ic == NULL || ic->scroll_factor == FLT_MIN) ? 1.0f : ic->scroll_factor;
@@ -1117,7 +1119,7 @@ static void dispatch_cursor_axis(struct sway_cursor *cursor,
}
// Scrolling on a tabbed or stacked title bar (handled as press event)
- if (!handled && on_titlebar) {
+ if (!handled && (on_titlebar || on_titlebar_border)) {
enum sway_container_layout layout = container_parent_layout(cont);
if (layout == L_TABBED || layout == L_STACKED) {
struct sway_node *tabcontainer = node_get_parent(node);