This makes scaling work e.g. on the Librem 5's built-in display which
has a 720x1440 resolution. It's scaled to 200% by default so currently
hitting the 100% button makes it scale to 100% but then the 200% button
vanishes due to assumed too small resultion. Fix that by allowing for
360x720 as well.
When swicthing configurations, we should ensure that the selected scale
is valid. This is complicated by the fact that it depends on other
factors whether we need a single global scale or not.
Try to retain the scale that monitors have if possible. If that does not
work, try to use the old scale of the primary monitor everywhere. This
should result in a good behaviour in most situations.
Co-authored-by: Stéphane Travostino <steph@combo.cc>
Fixes: #1038
The UI rebuilding code may change the configuration type, which in turn
can trigger a UI rebuild. This should not be done if we are already
updating the UI (but must be done otherwise, as that means the user has
chosen to change the configuration).
Fixes: #1141
Gnome-control-center checks the display modes by
cc_display_config_is_scaled_mode_valid()
...
cc_display_config_dbus_is_scaled_mode_valid()
to exclude unusable low resolutions.
However, it is the current using resolution that going to be tested by
is_scaled_mode_allowed() in is_scale_allowed_by_active_monitors(), if it
is global scaled required or configured as cloning mode originally.
Therefor, it will check current using resolution again and again,
instead of the enumerated one. This leads gnome-control-center building
wrong resolution list on the panel.
This patch replaces the current mode with the enumerated mode to have
the correct resolution to be tested by is_scaled_mode_allowed().
Fixes#903
Make the panel class provide a cancellable that will be cancelled when the panel
is destroyed. Panel implementations can use this and not have to mangage the
cancellable themselves. Consolidate cases where panels had multiple cancellables
that were all being used for this behaviour.
Monitors may not always have a mode. This means we cannot look up the
mode on the fly, but instead need to have a heuristic to select a mode
if there is none.
Everything was in place already for this, except that one location was
still doing a fresh lookup, possibly causing a crash.
Fixes: #675
"Primary Display" and "Contains top bar and Activities" are visible when
you have >1 display connected and the "Join Displays" option is
selected. I can't work out how to see the "Active Display" string but it
sure looks translatable to me.
Some devices have panels with a native resolution in portrait mode. In
these cases the monitor will likely be used in landscape mode.
Accept the modes as if they are landscape rather than portrait. A
further improvement would be to restrict the orientation setting.
Fixes#639
Increasing the trough size by setting the min-height caused issue when
the scale was being fine-tuned. Changing the padding seems to have a
similar effect without triggering any such issue (with Adwaita).
Fixes#335
g-s-d was changed to use a better black body temperature calculation.
This strongly affects the effect of the color temperature (the default
is changed from 4000K to 2700K). Update the scale to represent a similar
range to default even if the distribution on the scale is quite
different.
This may happen under some conditions. Possibly due to a race condition
(i.e. we did not receive any configuration from mutter yet) or also if
we are not running on GNOME.
Add guards for NULL configuration. This configuration is never
applicable and mostly clears the UI.
Fixes: #604
Make possible to set scaled size constraints per configuration, and add a method
to verify if the current mode at scale is allowed for such config.
This allows to perform such check also in case we have global scaling enabled,
as in such case we must verify that all the selected current modes are supported
by the given scale.
FixesGNOME/mutter#407
It's good to have some space between the to and from widgets, so
they aren't squashed, and so they blend better with the colour
temperature slider below.
Ideally we'd just increase the space between the to and from
sections, and not also between the widgets and their labels, but
the approach in this commit isn't too bad.
The new Night Light page, as described by the latest mockups [1],
uses a listbox to display the options. Also, there is a small
revamp on how the disabled state is handled; it now is a switch
in a row, instead of an extra radio button.
This commit changes the Night Light page to have a listbox, and
uses libhandy's rows to achieve the desired interface.
Fixes https://gitlab.gnome.org/GNOME/gnome-control-center/issues/533
This introduces a GtkStack to handle the pages; move the
current panel to be the "displays" page; and adds the
Night Light page as "night-light".
A stack switcher was added, as a header widget, to control
the stack.
https://gitlab.gnome.org/GNOME/gnome-control-center/issues/533
In almost all cases, the configuration will be "valid" in the sense that
g-c-c can represent it in the UI. However, there are cases like
mirroring setups with three monitors that we do not allow.
In case that the user has such a configuration, ensure that the
configuration we represent is actually valid according to our
expectations. This should not affect normal use cases, but allows users
to recover again if the configuration is broken for some reason.
Fixes#383
When the user has more than two monitors, then they can disable each
monitor separately. If the user creates an invalid configuration because
they disabled the last monitor, then enable a different one immediately.
The new logic selects a single configuration type rather than detecting
which types can be considered valid. This simplifies the UI rebuilding
somewhat, but also changes some internal behaviour. We will now always
be in the correct mode internally, even if the UI may not represent this
change (i.e. with more than two monitors it always looks the same).
We should show unusable monitors in the monitor selection drop-down
list. So always add them to the combobox and add the code to make the
switch to enable them insensitive.
We should only enforce single mode, when we have exactly two monitors
and the two button UI is used to switch between them in single mode.
Move the code to ensure the single configuration into the relevant
callback handler, rather than trying to solve this globally.
We need to also set rebuilding while updating some other UI elements.
Make it into a counter to allow for recursive setting.
Note that additional checks for rebuilding will be added in later
commits.