Merge pull request #340 from emersion/switch-vt-no-hw-cursor

Do not set hw cursor if disabled when switching VT
This commit is contained in:
Drew DeVault 2017-10-26 13:10:18 -04:00 committed by GitHub
commit 92b41bb51f
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;
};