Do not set hw cursor if disabled when switching VT

This commit is contained in:
emersion 2017-10-26 18:58:44 +02:00
parent b3eec47d57
commit 9d587d759f
No known key found for this signature in database
GPG Key ID: 0FDE7BE0E88F5E48
3 changed files with 4 additions and 1 deletions

View File

@ -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");

View File

@ -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) {

View File

@ -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;
};