diff options
-rw-r--r-- | backend/drm/drm.c | 3 | ||||
-rw-r--r-- | include/wlr/types/wlr_output.h | 3 | ||||
-rw-r--r-- | types/output/state.c | 3 |
3 files changed, 7 insertions, 2 deletions
diff --git a/backend/drm/drm.c b/backend/drm/drm.c index 3b14c63e..2b09ca91 100644 --- a/backend/drm/drm.c +++ b/backend/drm/drm.c @@ -384,8 +384,7 @@ static void drm_connector_state_init(struct wlr_drm_connector_state *state, const struct wlr_output_state *base) { memset(state, 0, sizeof(*state)); state->base = base; - state->modeset = base->committed & - (WLR_OUTPUT_STATE_ENABLED | WLR_OUTPUT_STATE_MODE); + state->modeset = base->allow_artifacts; state->active = (base->committed & WLR_OUTPUT_STATE_ENABLED) ? base->enabled : conn->output.enabled; diff --git a/include/wlr/types/wlr_output.h b/include/wlr/types/wlr_output.h index c69a4a2b..309c2731 100644 --- a/include/wlr/types/wlr_output.h +++ b/include/wlr/types/wlr_output.h @@ -79,6 +79,9 @@ enum wlr_output_state_mode_type { */ struct wlr_output_state { uint32_t committed; // enum wlr_output_state_field + // Set to true to allow temporary visual artifacts (e.g. black screen) while + // the update is being applied + bool allow_artifacts; pixman_region32_t damage; // output-buffer-local coordinates bool enabled; float scale; diff --git a/types/output/state.c b/types/output/state.c index abfe5a64..08c1a9e8 100644 --- a/types/output/state.c +++ b/types/output/state.c @@ -4,6 +4,7 @@ void wlr_output_state_set_enabled(struct wlr_output_state *state, bool enabled) { state->committed |= WLR_OUTPUT_STATE_ENABLED; state->enabled = enabled; + state->allow_artifacts = true; } void wlr_output_state_set_mode(struct wlr_output_state *state, @@ -11,6 +12,7 @@ void wlr_output_state_set_mode(struct wlr_output_state *state, state->committed |= WLR_OUTPUT_STATE_MODE; state->mode_type = WLR_OUTPUT_STATE_MODE_FIXED; state->mode = mode; + state->allow_artifacts = true; } void wlr_output_state_set_custom_mode(struct wlr_output_state *state, @@ -20,6 +22,7 @@ void wlr_output_state_set_custom_mode(struct wlr_output_state *state, state->custom_mode.width = width; state->custom_mode.height = height; state->custom_mode.refresh = refresh; + state->allow_artifacts = true; } void wlr_output_state_set_scale(struct wlr_output_state *state, float scale) { |