diff options
-rw-r--r-- | backend/drm/backend.c | 2 | ||||
-rw-r--r-- | backend/drm/drm.c | 2 | ||||
-rw-r--r-- | include/backend/drm/drm.h | 1 |
3 files changed, 4 insertions, 1 deletions
diff --git a/backend/drm/backend.c b/backend/drm/backend.c index 40b559e2..af2619ff 100644 --- a/backend/drm/backend.c +++ b/backend/drm/backend.c @@ -76,7 +76,7 @@ static void session_signal(struct wl_listener *listener, void *data) { struct wlr_drm_plane *plane = conn->crtc->cursor; drm->iface->crtc_set_cursor(drm, conn->crtc, - plane ? plane->cursor_bo : NULL); + (plane && plane->cursor_enabled) ? plane->cursor_bo : NULL); } } else { wlr_log(L_INFO, "DRM fd paused"); diff --git a/backend/drm/drm.c b/backend/drm/drm.c index 441ba24e..a3594bb0 100644 --- a/backend/drm/drm.c +++ b/backend/drm/drm.c @@ -505,8 +505,10 @@ static bool wlr_drm_connector_set_cursor(struct wlr_output *output, if (!buf && update_pixels) { // Hide the cursor + plane->cursor_enabled = false; return drm->iface->crtc_set_cursor(drm, crtc, NULL); } + plane->cursor_enabled = true; // We don't have a real cursor plane, so we make a fake one if (!plane) { diff --git a/include/backend/drm/drm.h b/include/backend/drm/drm.h index 4d23f963..a6dd247c 100644 --- a/include/backend/drm/drm.h +++ b/include/backend/drm/drm.h @@ -33,6 +33,7 @@ struct wlr_drm_plane { float matrix[16]; struct wlr_texture *wlr_tex; struct gbm_bo *cursor_bo; + bool cursor_enabled; union wlr_drm_plane_props props; }; |