backend/drm: Remove automatic reset on VT switch

Instead of trying to restore the drm state when the session is activated
again, just disconnect all outputs when the session is deactivated. The
scan that triggers on session activation will rediscover the connectors.
This commit is contained in:
Kenny Levinsen 2024-10-28 12:51:27 +01:00
parent 3df1528a8f
commit 0f255b46fc
3 changed files with 8 additions and 104 deletions

View file

@ -117,11 +117,18 @@ static void handle_session_active(struct wl_listener *listener, void *data) {
wlr_log(WLR_INFO, "DRM FD %s", session->active ? "resumed" : "paused");
if (!session->active) {
// Disconnect any active connectors so that the client will modeset and
// rerender when the session is activated again.
struct wlr_drm_connector *conn;
wl_list_for_each(conn, &drm->connectors, link) {
if (conn->status == DRM_MODE_CONNECTED) {
wlr_output_destroy(&conn->output);
}
}
return;
}
scan_drm_connectors(drm, NULL);
restore_drm_device(drm);
}
static void handle_dev_change(struct wl_listener *listener, void *data) {