mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-22 21:05:58 +01:00
Fix possible use of CRTC after monitor is unplugged
This commit is contained in:
parent
5465621d0a
commit
fe2fbd0fad
1 changed files with 6 additions and 2 deletions
|
@ -785,14 +785,18 @@ static void page_flip_handler(int fd, unsigned seq,
|
|||
struct wlr_backend_state *drm =
|
||||
wl_container_of(output->renderer, drm, renderer);
|
||||
|
||||
output->pageflip_pending = false;
|
||||
if (output->state != WLR_DRM_OUTPUT_CONNECTED) {
|
||||
return;
|
||||
}
|
||||
|
||||
struct wlr_drm_plane *plane = output->crtc->primary;
|
||||
if (plane->front) {
|
||||
gbm_surface_release_buffer(plane->gbm, plane->front);
|
||||
plane->front = NULL;
|
||||
}
|
||||
|
||||
output->pageflip_pending = false;
|
||||
if (output->state == WLR_DRM_OUTPUT_CONNECTED && drm->session->active) {
|
||||
if (drm->session->active) {
|
||||
wl_signal_emit(&output->base->events.frame, output->base);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue