diff options
author | Simon Ser <contact@emersion.fr> | 2020-12-26 11:42:23 +0100 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2021-01-03 19:34:54 +0100 |
commit | 576ff57db09f6f4ee523a567712a3ffcf5dc45a8 (patch) | |
tree | 77a8ee86a79b54ffe55d001aefa6c4f5d9a95844 /backend | |
parent | eb30cde77751aaf11a6a754d053a50df5399739c (diff) |
backend/drm: ignore hotplug events while inactive
When the session is inactive, we can't change the KMS state. Ignore
hotplug events so that compositors don't try to perform a modeset when
a connector is plugged in. We already re-scan connectors when the
session becomes active.
To test, run a wlroots compositor on VT 1, switch to VT 2, unplug a
connector, re-plug it, switch back to VT 1. Without this patch the
screen is black on VT 1.
References: https://github.com/swaywm/wlroots/issues/2370
Diffstat (limited to 'backend')
-rw-r--r-- | backend/drm/backend.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/backend/drm/backend.c b/backend/drm/backend.c index 27f9d045..cc48aa54 100644 --- a/backend/drm/backend.c +++ b/backend/drm/backend.c @@ -109,8 +109,11 @@ static void handle_session_active(struct wl_listener *listener, void *data) { static void handle_dev_change(struct wl_listener *listener, void *data) { struct wlr_drm_backend *drm = wl_container_of(listener, drm, dev_change); - wlr_log(WLR_DEBUG, "%s invalidated", drm->name); + if (!drm->session->active) { + return; + } + wlr_log(WLR_DEBUG, "%s invalidated", drm->name); scan_drm_connectors(drm); } |