Fix flickering when switching VT

This commit is contained in:
emersion 2018-01-27 11:16:42 +01:00
parent 7111dd79ef
commit 7adf13e284
No known key found for this signature in database
GPG Key ID: 0FDE7BE0E88F5E48
3 changed files with 10 additions and 7 deletions

View File

@ -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) { static bool wlr_drm_connector_swap_buffers(struct wlr_output *output) {
struct wlr_drm_connector *conn = (struct wlr_drm_connector *)output; struct wlr_drm_connector *conn = (struct wlr_drm_connector *)output;
struct wlr_drm_backend *drm = (struct wlr_drm_backend *)output->backend; struct wlr_drm_backend *drm = (struct wlr_drm_backend *)output->backend;
if (!drm->session->active) {
return false;
}
struct wlr_drm_crtc *crtc = conn->crtc; struct wlr_drm_crtc *crtc = conn->crtc;
if (!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_backend *drm = (struct wlr_drm_backend *)output->backend;
struct wlr_drm_renderer *renderer = &drm->renderer; struct wlr_drm_renderer *renderer = &drm->renderer;
if (!drm->session->active) {
return false;
}
struct wlr_drm_crtc *crtc = conn->crtc; struct wlr_drm_crtc *crtc = conn->crtc;
if (!crtc) { if (!crtc) {
return false; return false;
@ -644,6 +651,9 @@ static bool wlr_drm_connector_move_cursor(struct wlr_output *output,
int x, int y) { int x, int y) {
struct wlr_drm_connector *conn = (struct wlr_drm_connector *)output; struct wlr_drm_connector *conn = (struct wlr_drm_connector *)output;
struct wlr_drm_backend *drm = (struct wlr_drm_backend *)output->backend; struct wlr_drm_backend *drm = (struct wlr_drm_backend *)output->backend;
if (!drm->session->active) {
return false;
}
if (!conn->crtc) { if (!conn->crtc) {
return false; return false;
} }

View File

@ -419,8 +419,6 @@ static void render_output(struct roots_output *output) {
goto renderer_end; goto renderer_end;
} }
wlr_renderer_clear(output->desktop->server->renderer, 1, 1, 1, 1);
int nrects; int nrects;
pixman_box32_t *rects = pixman_region32_rectangles(&damage, &nrects); pixman_box32_t *rects = pixman_region32_rectangles(&damage, &nrects);
for (int i = 0; i < nrects; ++i) { for (int i = 0; i < nrects; ++i) {

View File

@ -184,11 +184,6 @@ void wlr_output_update_mode(struct wlr_output *output,
void wlr_output_update_custom_mode(struct wlr_output *output, int32_t width, void wlr_output_update_custom_mode(struct wlr_output *output, int32_t width,
int32_t height, int32_t refresh) { int32_t height, int32_t refresh) {
if (output->width == width && output->height == height &&
output->refresh == refresh) {
return;
}
output->width = width; output->width = width;
output->height = height; output->height = height;
wlr_output_update_matrix(output); wlr_output_update_matrix(output);