fixed many segfaults

This commit is contained in:
William McKinnon 2024-02-02 02:46:48 -05:00
parent a27fa243ad
commit 30e18aae07
4 changed files with 9 additions and 6 deletions

View file

@ -365,6 +365,9 @@ static bool should_configure(struct sway_node *node,
if (!node_is_view(node)) {
return false;
}
if (node->sway_container->is_fading_out) {
return false;
}
if (node->destroying) {
return false;
}
@ -401,7 +404,6 @@ static void transaction_commit(struct sway_transaction *transaction) {
for (int i = 0; i < transaction->instructions->length; ++i) {
struct sway_transaction_instruction *instruction =
transaction->instructions->items[i];
printf("processing instruction for %s\n", instruction->node->sway_container->title);
struct sway_node *node = instruction->node;
bool hidden = node_is_view(node) && !node->destroying &&
!view_is_visible(node->sway_container->view);

View file

@ -1097,7 +1097,7 @@ bool seat_is_input_allowed(struct sway_seat *seat,
}
static void send_unfocus(struct sway_container *con, void *data) {
if (con->view) {
if (con->view && !con->is_fading_out) {
view_set_activated(con->view, false);
}
}
@ -1245,7 +1245,7 @@ static void seat_set_workspace_focus(struct sway_seat *seat, struct sway_node *n
}
// Close any popups on the old focus
if (last_focus && node_is_view(last_focus)) {
if (last_focus && node_is_view(last_focus) && !last_focus->sway_container->is_fading_out) {
view_close_popups(last_focus->sway_container->view);
}

View file

@ -571,7 +571,7 @@ static void check_focus_follows_mouse(struct sway_seat *seat,
// This is where we handle the common case. We don't want to focus inactive
// tabs, hence the view_is_visible check.
if (node_is_view(hovered_node) &&
if (node_is_view(hovered_node) && !hovered_node->sway_container->is_fading_out &&
view_is_visible(hovered_node->sway_container->view)) {
// e->previous_node is the node which the cursor was over previously.
// If focus_follows_mouse is yes and the cursor got over the view due

View file

@ -171,7 +171,7 @@ void view_get_constraints(struct sway_view *view, double *min_width,
uint32_t view_configure(struct sway_view *view, double lx, double ly, int width,
int height) {
if (view->impl->configure) {
if (view->impl->configure && !view->container->is_fading_out) {
return view->impl->configure(view, lx, ly, width, height);
}
return 0;
@ -430,7 +430,7 @@ void view_set_tiled(struct sway_view *view, bool tiled) {
}
void view_close(struct sway_view *view) {
if (view->impl->close) {
if (view->impl->close && !view->container->is_fading_out) {
view->impl->close(view);
}
}
@ -942,6 +942,7 @@ void view_unmap(struct sway_view *view) {
workspace_detect_urgent(ws);
}
*/
// TODO: deactivate input / focus
struct sway_seat *seat;
wl_list_for_each(seat, &server.input->seats, link) {
seat->cursor->image_surface = NULL;