diff options
-rw-r--r-- | sway/input/cursor.c | 8 | ||||
-rw-r--r-- | sway/tree/output.c | 2 |
2 files changed, 8 insertions, 2 deletions
diff --git a/sway/input/cursor.c b/sway/input/cursor.c index 96feb47d..409e7b12 100644 --- a/sway/input/cursor.c +++ b/sway/input/cursor.c | |||
@@ -85,6 +85,10 @@ static struct sway_node *node_at_coords( | |||
85 | return NULL; | 85 | return NULL; |
86 | } | 86 | } |
87 | struct sway_output *output = wlr_output->data; | 87 | struct sway_output *output = wlr_output->data; |
88 | if (!output) { | ||
89 | // output is being destroyed | ||
90 | return NULL; | ||
91 | } | ||
88 | double ox = lx, oy = ly; | 92 | double ox = lx, oy = ly; |
89 | wlr_output_layout_output_coords(root->output_layout, wlr_output, &ox, &oy); | 93 | wlr_output_layout_output_coords(root->output_layout, wlr_output, &ox, &oy); |
90 | 94 | ||
@@ -1092,6 +1096,8 @@ static void dispatch_cursor_axis(struct sway_cursor *cursor, | |||
1092 | enum wlr_edges edge = cont ? find_edge(cont, cursor) : WLR_EDGE_NONE; | 1096 | enum wlr_edges edge = cont ? find_edge(cont, cursor) : WLR_EDGE_NONE; |
1093 | bool on_border = edge != WLR_EDGE_NONE; | 1097 | bool on_border = edge != WLR_EDGE_NONE; |
1094 | bool on_titlebar = cont && !on_border && !surface; | 1098 | bool on_titlebar = cont && !on_border && !surface; |
1099 | bool on_titlebar_border = cont && on_border && | ||
1100 | cursor->cursor->y < cont->content_y; | ||
1095 | bool on_contents = cont && !on_border && surface; | 1101 | bool on_contents = cont && !on_border && surface; |
1096 | float scroll_factor = | 1102 | float scroll_factor = |
1097 | (ic == NULL || ic->scroll_factor == FLT_MIN) ? 1.0f : ic->scroll_factor; | 1103 | (ic == NULL || ic->scroll_factor == FLT_MIN) ? 1.0f : ic->scroll_factor; |
@@ -1117,7 +1123,7 @@ static void dispatch_cursor_axis(struct sway_cursor *cursor, | |||
1117 | } | 1123 | } |
1118 | 1124 | ||
1119 | // Scrolling on a tabbed or stacked title bar (handled as press event) | 1125 | // Scrolling on a tabbed or stacked title bar (handled as press event) |
1120 | if (!handled && on_titlebar) { | 1126 | if (!handled && (on_titlebar || on_titlebar_border)) { |
1121 | enum sway_container_layout layout = container_parent_layout(cont); | 1127 | enum sway_container_layout layout = container_parent_layout(cont); |
1122 | if (layout == L_TABBED || layout == L_STACKED) { | 1128 | if (layout == L_TABBED || layout == L_STACKED) { |
1123 | struct sway_node *tabcontainer = node_get_parent(node); | 1129 | struct sway_node *tabcontainer = node_get_parent(node); |
diff --git a/sway/tree/output.c b/sway/tree/output.c index 95ab9378..f24be010 100644 --- a/sway/tree/output.c +++ b/sway/tree/output.c | |||
@@ -58,6 +58,7 @@ struct sway_output *output_create(struct wlr_output *wlr_output) { | |||
58 | wlr_output->data = output; | 58 | wlr_output->data = output; |
59 | 59 | ||
60 | wl_signal_add(&wlr_output->events.destroy, &output->destroy); | 60 | wl_signal_add(&wlr_output->events.destroy, &output->destroy); |
61 | wl_signal_init(&output->events.destroy); | ||
61 | 62 | ||
62 | wl_list_insert(&root->all_outputs, &output->link); | 63 | wl_list_insert(&root->all_outputs, &output->link); |
63 | 64 | ||
@@ -76,7 +77,6 @@ void output_enable(struct sway_output *output, struct output_config *oc) { | |||
76 | for (size_t i = 0; i < len; ++i) { | 77 | for (size_t i = 0; i < len; ++i) { |
77 | wl_list_init(&output->layers[i]); | 78 | wl_list_init(&output->layers[i]); |
78 | } | 79 | } |
79 | wl_signal_init(&output->events.destroy); | ||
80 | 80 | ||
81 | output->enabled = true; | 81 | output->enabled = true; |
82 | list_add(root->outputs, output); | 82 | list_add(root->outputs, output); |