compositor: Refactor weston_output_mode_switch()
This breaks weston_output_mode_switch() into 3 functions:
weston_output_mode_set_native()
weston_output_mode_switch_to_temporary()
weston_output_mode_switch_to_native()
Differences from previous behaviour:
SET_NATIVE didn't set current_scale (now it does)
SET_TEMPORARY could set mode and scale independently - now it can't.
Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Pekka Paalanen <pekka.paalanen@collabora.co.uk>
diff --git a/fullscreen-shell/fullscreen-shell.c b/fullscreen-shell/fullscreen-shell.c
index c7950df..35e6d8f 100644
--- a/fullscreen-shell/fullscreen-shell.c
+++ b/fullscreen-shell/fullscreen-shell.c
@@ -284,12 +284,8 @@
static void
restore_output_mode(struct weston_output *output)
{
- if (output->original_mode ||
- (int32_t)output->current_scale != output->original_scale)
- weston_output_switch_mode(output,
- output->native_mode,
- output->native_scale,
- WESTON_MODE_SWITCH_RESTORE_NATIVE);
+ if (output->original_mode)
+ weston_output_mode_switch_to_native(output);
}
/*
@@ -472,9 +468,8 @@
mode.height = surf_height * fsout->output->native_scale;
mode.refresh = fsout->pending.framerate;
- ret = weston_output_switch_mode(fsout->output, &mode,
- fsout->output->native_scale,
- WESTON_MODE_SWITCH_SET_TEMPORARY);
+ ret = weston_output_mode_switch_to_temporary(fsout->output, &mode,
+ fsout->output->native_scale);
if (ret != 0) {
/* The mode switch failed. Clear the pending and