diff options
Diffstat (limited to 'sway/input/cursor.c')
-rw-r--r-- | sway/input/cursor.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/sway/input/cursor.c b/sway/input/cursor.c index 0d5e9361..9af7ef57 100644 --- a/sway/input/cursor.c +++ b/sway/input/cursor.c | |||
@@ -87,6 +87,10 @@ static struct sway_node *node_at_coords( | |||
87 | return NULL; | 87 | return NULL; |
88 | } | 88 | } |
89 | struct sway_output *output = wlr_output->data; | 89 | struct sway_output *output = wlr_output->data; |
90 | if (!output) { | ||
91 | // output is being destroyed | ||
92 | return NULL; | ||
93 | } | ||
90 | double ox = lx, oy = ly; | 94 | double ox = lx, oy = ly; |
91 | wlr_output_layout_output_coords(root->output_layout, wlr_output, &ox, &oy); | 95 | wlr_output_layout_output_coords(root->output_layout, wlr_output, &ox, &oy); |
92 | 96 | ||
@@ -1094,6 +1098,8 @@ static void dispatch_cursor_axis(struct sway_cursor *cursor, | |||
1094 | enum wlr_edges edge = cont ? find_edge(cont, cursor) : WLR_EDGE_NONE; | 1098 | enum wlr_edges edge = cont ? find_edge(cont, cursor) : WLR_EDGE_NONE; |
1095 | bool on_border = edge != WLR_EDGE_NONE; | 1099 | bool on_border = edge != WLR_EDGE_NONE; |
1096 | bool on_titlebar = cont && !on_border && !surface; | 1100 | bool on_titlebar = cont && !on_border && !surface; |
1101 | bool on_titlebar_border = cont && on_border && | ||
1102 | cursor->cursor->y < cont->content_y; | ||
1097 | bool on_contents = cont && !on_border && surface; | 1103 | bool on_contents = cont && !on_border && surface; |
1098 | float scroll_factor = | 1104 | float scroll_factor = |
1099 | (ic == NULL || ic->scroll_factor == FLT_MIN) ? 1.0f : ic->scroll_factor; | 1105 | (ic == NULL || ic->scroll_factor == FLT_MIN) ? 1.0f : ic->scroll_factor; |
@@ -1119,7 +1125,7 @@ static void dispatch_cursor_axis(struct sway_cursor *cursor, | |||
1119 | } | 1125 | } |
1120 | 1126 | ||
1121 | // Scrolling on a tabbed or stacked title bar (handled as press event) | 1127 | // Scrolling on a tabbed or stacked title bar (handled as press event) |
1122 | if (!handled && on_titlebar) { | 1128 | if (!handled && (on_titlebar || on_titlebar_border)) { |
1123 | enum sway_container_layout layout = container_parent_layout(cont); | 1129 | enum sway_container_layout layout = container_parent_layout(cont); |
1124 | if (layout == L_TABBED || layout == L_STACKED) { | 1130 | if (layout == L_TABBED || layout == L_STACKED) { |
1125 | struct sway_node *tabcontainer = node_get_parent(node); | 1131 | struct sway_node *tabcontainer = node_get_parent(node); |