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 <pekka.paalanen@collabora.co.uk>
This commit is contained in:
parent
01030c04b3
commit
728fdde3c8
|
@ -2247,11 +2247,11 @@ shell_surface_set_class(struct wl_client *client,
|
||||||
static void
|
static void
|
||||||
restore_output_mode(struct weston_output *output)
|
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)
|
(int32_t)output->current_scale != output->original_scale)
|
||||||
weston_output_switch_mode(output,
|
weston_output_switch_mode(output,
|
||||||
output->original_mode,
|
output->native_mode,
|
||||||
output->original_scale,
|
output->native_scale,
|
||||||
WESTON_MODE_SWITCH_RESTORE_NATIVE);
|
WESTON_MODE_SWITCH_RESTORE_NATIVE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -284,11 +284,11 @@ fs_output_for_output(struct weston_output *output)
|
||||||
static void
|
static void
|
||||||
restore_output_mode(struct weston_output *output)
|
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)
|
(int32_t)output->current_scale != output->original_scale)
|
||||||
weston_output_switch_mode(output,
|
weston_output_switch_mode(output,
|
||||||
output->original_mode,
|
output->native_mode,
|
||||||
output->original_scale,
|
output->native_scale,
|
||||||
WESTON_MODE_SWITCH_RESTORE_NATIVE);
|
WESTON_MODE_SWITCH_RESTORE_NATIVE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue