e977d65...
by
=?utf-8?q?Florian_M=C3=BCllner?= <email address hidden>
monitor: Allow %NULL mode in calculate_mode_scale()
If no global scaling factor has been set, we currently segfault when
called with a %NULL mode parameter, which happens when calculating the
scale for the current mode while no modes are available.
Adding %NULL checks in the corresponding callers would mean that we'd
have to duplicate the global scaling factor handling, so instead consider
%NULL mode parameters valid and handle them gracefully.
We just arbitrarily chose the first EGL config matching the passed
attributes, but we then assumed we always got GBM_FORMAT_XRGB8888. That
was not a correct assumption. Instead, make sure we always pick the
format we expect.
When painting the titlebar, button icons that aren't available in the
desired size need to be scaled. However the current code inverses the
scale factor, with the result that the adjusted icons are much worse
than the original icons, whoops.
This went unnoticed for a long time given that most icons are availa-
ble in the desired 16x16 size, and the most likely exceptions - window
icons - are not shown by default.