diff options
author | emersion <contact@emersion.fr> | 2019-01-10 00:32:09 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-10 00:32:09 +0100 |
commit | d0b9701820bd92e008e73693d5e61d672372e7e1 (patch) | |
tree | d79b572e87e9f95151f762078d427c5839798384 /sway/input | |
parent | Reset container dimensions when moving into workspace from direction (diff) | |
parent | cursor: allow scrolling tabs/stack on title border (diff) | |
download | sway-d0b9701820bd92e008e73693d5e61d672372e7e1.tar.gz sway-d0b9701820bd92e008e73693d5e61d672372e7e1.tar.zst sway-d0b9701820bd92e008e73693d5e61d672372e7e1.zip |
Merge pull request #3396 from RedSoxFan/scroll-titlebar-border
cursor: allow scrolling tabs/stack on title border
Diffstat (limited to 'sway/input')
-rw-r--r-- | sway/input/cursor.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sway/input/cursor.c b/sway/input/cursor.c index 96feb47d..07c3fe1d 100644 --- a/sway/input/cursor.c +++ b/sway/input/cursor.c | |||
@@ -1092,6 +1092,8 @@ static void dispatch_cursor_axis(struct sway_cursor *cursor, | |||
1092 | enum wlr_edges edge = cont ? find_edge(cont, cursor) : WLR_EDGE_NONE; | 1092 | enum wlr_edges edge = cont ? find_edge(cont, cursor) : WLR_EDGE_NONE; |
1093 | bool on_border = edge != WLR_EDGE_NONE; | 1093 | bool on_border = edge != WLR_EDGE_NONE; |
1094 | bool on_titlebar = cont && !on_border && !surface; | 1094 | bool on_titlebar = cont && !on_border && !surface; |
1095 | bool on_titlebar_border = cont && on_border && | ||
1096 | cursor->cursor->y < cont->content_y; | ||
1095 | bool on_contents = cont && !on_border && surface; | 1097 | bool on_contents = cont && !on_border && surface; |
1096 | float scroll_factor = | 1098 | float scroll_factor = |
1097 | (ic == NULL || ic->scroll_factor == FLT_MIN) ? 1.0f : ic->scroll_factor; | 1099 | (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, | |||
1117 | } | 1119 | } |
1118 | 1120 | ||
1119 | // Scrolling on a tabbed or stacked title bar (handled as press event) | 1121 | // Scrolling on a tabbed or stacked title bar (handled as press event) |
1120 | if (!handled && on_titlebar) { | 1122 | if (!handled && (on_titlebar || on_titlebar_border)) { |
1121 | enum sway_container_layout layout = container_parent_layout(cont); | 1123 | enum sway_container_layout layout = container_parent_layout(cont); |
1122 | if (layout == L_TABBED || layout == L_STACKED) { | 1124 | if (layout == L_TABBED || layout == L_STACKED) { |
1123 | struct sway_node *tabcontainer = node_get_parent(node); | 1125 | struct sway_node *tabcontainer = node_get_parent(node); |