Skip to content

Commit

Permalink
Fixed null bug foreign top level
Browse files Browse the repository at this point in the history
  • Loading branch information
Carl-github-acc committed Sep 4, 2023
2 parents d9a5f38 + fd0eaad commit 24b963d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions dwl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1521,7 +1521,7 @@ focusclient(Client *c, int lift)

client_activate_surface(old, 0);
}
if (old_c->foreign_toplevel) {
if (old_c->foreign_toplevel && old_c->mon && old_c->mon->wlr_output) {
wlr_foreign_toplevel_handle_v1_output_leave(old_c->foreign_toplevel, old_c->mon->wlr_output);
}
}
Expand All @@ -1541,7 +1541,8 @@ focusclient(Client *c, int lift)

/* Activate the new client */
client_activate_surface(client_surface(c), 1);
if (c->foreign_toplevel) {

if (c->foreign_toplevel && c->mon && c->mon->wlr_output) {
wlr_foreign_toplevel_handle_v1_output_enter(c->foreign_toplevel, c->mon->wlr_output);
}
}
Expand Down

0 comments on commit 24b963d

Please sign in to comment.