wayland: Make sure we're initializing output scale sensibly

Summary:
By default the E_NEW() will create our output objects with a 0.0 scale,
which doesn't make any sense and if anything will lead to crashes.
Instead use a scale factor of 1.0.

When updating output details, if the scale setting is invalid then set
it to 1.0 as a sensible value.

Note this doesn't actually enable scaling, just helps make sure we're
not injecting invalid scale parameters from the start.

Reviewers: zmike, devilhorns, cedric

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D2078
This commit is contained in:
Bryce Harrington 2015-02-27 19:45:24 -05:00 committed by Mike Blumenkrantz
parent 9a4024a20a
commit f92e241e8e
1 changed files with 4 additions and 0 deletions

View File

@ -2793,6 +2793,7 @@ e_comp_wl_output_init(const char *id, const char *make, const char *model, int x
output->global = wl_global_create(cdata->wl.disp, &wl_output_interface,
2, output, _e_comp_wl_cb_output_bind);
output->resources = NULL;
output->scale = 1.0;
}
/* update the output details */
@ -2806,6 +2807,9 @@ e_comp_wl_output_init(const char *id, const char *make, const char *model, int x
output->subpixel = subpixel;
output->transform = transform;
if (output->scale <= 0)
output->scale = 1.0;
/* if we have bound resources, send updates */
EINA_LIST_FOREACH(output->resources, l2, resource)
{