From 69c6273f28e75ce8f42ccc36eb9257f1871a9ef2 Mon Sep 17 00:00:00 2001 From: Derek Foreman Date: Fri, 19 Sep 2014 14:43:23 -0500 Subject: shell: fix weston_output_mode_switch() usage Calling weston_output_mode_switch() with WESTON_MODE_SWITCH_RESTORE_NATIVE will result in the mode being set "back" to the passed in mode - so the passed mode should be the native mode. Additionally, weston_output_mode_switch() should be called when output->original_mode is non-NULL (which indicates we had a temporary mode set). The comparison to current_mode results in a lot of log chatter. Acked-by: Pekka Paalanen --- desktop-shell/shell.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'desktop-shell') diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c index 3a5a702a..6ef36b5b 100644 --- a/desktop-shell/shell.c +++ b/desktop-shell/shell.c @@ -2247,11 +2247,11 @@ shell_surface_set_class(struct wl_client *client, static void restore_output_mode(struct weston_output *output) { - if (output->current_mode != output->original_mode || + if (output->original_mode || (int32_t)output->current_scale != output->original_scale) weston_output_switch_mode(output, - output->original_mode, - output->original_scale, + output->native_mode, + output->native_scale, WESTON_MODE_SWITCH_RESTORE_NATIVE); } -- cgit v1.2.3