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/desktop-shell/shell.c b/desktop-shell/shell.c
index 9fafb39..844a322 100644
--- a/desktop-shell/shell.c
+++ b/desktop-shell/shell.c
@@ -2247,12 +2247,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);
}
static void
@@ -2876,8 +2872,8 @@
surf_height * surface->buffer_viewport.buffer.scale,
shsurf->fullscreen.framerate};
- if (weston_output_switch_mode(output, &mode, surface->buffer_viewport.buffer.scale,
- WESTON_MODE_SWITCH_SET_TEMPORARY) == 0) {
+ if (weston_output_mode_switch_to_temporary(output, &mode,
+ surface->buffer_viewport.buffer.scale) == 0) {
weston_view_set_position(shsurf->view,
output->x - surf_x,
output->y - surf_y);