aboutsummaryrefslogtreecommitdiff
path: root/backend/drm/drm.c
diff options
context:
space:
mode:
authoremersion <contact@emersion.fr>2018-01-27 11:16:42 +0100
committeremersion <contact@emersion.fr>2018-01-27 11:16:42 +0100
commit7adf13e2840bf57a2b96b73462fc7c6ca8e363da (patch)
tree012699feddf69f5c99b4895e7e1c10300901a918 /backend/drm/drm.c
parent7111dd79efb6cccf39866051a92090cfc9ea5c67 (diff)
Fix flickering when switching VT
Diffstat (limited to 'backend/drm/drm.c')
-rw-r--r--backend/drm/drm.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/backend/drm/drm.c b/backend/drm/drm.c
index c3ff0d55..b9aae948 100644
--- a/backend/drm/drm.c
+++ b/backend/drm/drm.c
@@ -192,6 +192,9 @@ static bool wlr_drm_connector_make_current(struct wlr_output *output,
static bool wlr_drm_connector_swap_buffers(struct wlr_output *output) {
struct wlr_drm_connector *conn = (struct wlr_drm_connector *)output;
struct wlr_drm_backend *drm = (struct wlr_drm_backend *)output->backend;
+ if (!drm->session->active) {
+ return false;
+ }
struct wlr_drm_crtc *crtc = conn->crtc;
if (!crtc) {
@@ -516,6 +519,10 @@ static bool wlr_drm_connector_set_cursor(struct wlr_output *output,
struct wlr_drm_backend *drm = (struct wlr_drm_backend *)output->backend;
struct wlr_drm_renderer *renderer = &drm->renderer;
+ if (!drm->session->active) {
+ return false;
+ }
+
struct wlr_drm_crtc *crtc = conn->crtc;
if (!crtc) {
return false;
@@ -644,6 +651,9 @@ static bool wlr_drm_connector_move_cursor(struct wlr_output *output,
int x, int y) {
struct wlr_drm_connector *conn = (struct wlr_drm_connector *)output;
struct wlr_drm_backend *drm = (struct wlr_drm_backend *)output->backend;
+ if (!drm->session->active) {
+ return false;
+ }
if (!conn->crtc) {
return false;
}