compositor-drm: Allow weston_output_mode_switch_to_native() to work.
authorMario Kleiner <mario.kleiner.de@gmail.com>
Sun, 21 Jun 2015 19:25:11 +0000 (21:25 +0200)
committerBryce Harrington <bryce@osg.samsung.com>
Tue, 30 Jun 2015 19:19:58 +0000 (12:19 -0700)
commit808170452b237faf4d57968e1f1eb8615b0e2a2a
treed8e320ea84c4a3af6ad8b671f38fbf920e90b968
parent872797cdf5c23d85d9abf5531a3dc7141c693e62
compositor-drm: Allow weston_output_mode_switch_to_native() to work.

Initialize output->native_mode with the initially chosen
mode for an output, so weston_output_mode_switch_to_native()
has something to work with and can switch back from temporary
selected modes to the outputs native mode. Before, this was a
no-op.

This allows an output to switch back to its default mode if
a former toplevel fullscreen shell surface created via method
WL_SHELL_SURFACE_FULLSCREEN_METHOD_DRIVER gets destroyed, or
it gets demoted to non-fullscreen, or if modesetting on the
output failed for some reason.

v2: Modified and split into a separate patch from original
    patch "Allow restore_output_mode() to work properly.",
    as suggested by Derek Foreman.

Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Cc: Derek Foreman <derekf@osg.samsung.com>
Reviewed-By: Derek Foreman <derekf@osg.samsung.com>
src/compositor-drm.c