fix crash when a client is created while all outputs are disabled

This commit is contained in:
Leonardo Hernández Hernández 2024-08-25 11:33:54 -06:00
parent 0e0c97db56
commit cfc80c8f44
No known key found for this signature in database
GPG key ID: E538897EE11B9624
2 changed files with 7 additions and 2 deletions

View file

@ -12,6 +12,9 @@
### Deprecated
### Removed
### Fixed
* Crash when a client is created while all outputs are disabled.
### Security
### Contributors

6
dwl.c
View file

@ -803,8 +803,10 @@ commitnotify(struct wl_listener *listener, void *data)
* a wrong monitor.
*/
applyrules(c);
wlr_surface_set_preferred_buffer_scale(client_surface(c), (int)ceilf(c->mon->wlr_output->scale));
wlr_fractional_scale_v1_notify_scale(client_surface(c), c->mon->wlr_output->scale);
if (c->mon) {
wlr_surface_set_preferred_buffer_scale(client_surface(c), (int)ceilf(c->mon->wlr_output->scale));
wlr_fractional_scale_v1_notify_scale(client_surface(c), c->mon->wlr_output->scale);
}
setmon(c, NULL, 0); /* Make sure to reapply rules in mapnotify() */
wlr_xdg_toplevel_set_wm_capabilities(c->surface.xdg->toplevel, WLR_XDG_TOPLEVEL_WM_CAPABILITIES_FULLSCREEN);