We were converting the floating point numbers to integers using a cast,
which causes them to be always rounded down. The result is that a
monitor may be too small by a pixel, creating broken configurations.
Also fix the same issue when calculating whether a scale should be
supported.
See https://gitlab.gnome.org/GNOME/mutter/issues/412
Anything that affects the size of the screen (or its existance) may
result in invalid configurations. Do a small effort in trying to fix
this by calling into the snapping algorithm for the modified monitor.
Addresses issue #247 to a large extend.
Previously, low resolutions were hidden from the control center
because when such display modes are activated, GNOME is unusable;
many important UI elements do not fit on the screen at all.
https://bugzilla.gnome.org/show_bug.cgi?id=626822
This was removed in c0f686bb0f
without explanation; reinstate it here.
Also prevent the scaling from being selected or activated if the
effective scaled resolution would result in an equivalently low
resolution being used.
We need to re-sync the scale button scale when updating the state
dynamically. Otherwise changing the resolution will always show a scale
of 100% (first item) rather than the actual active one.
The visibility is explicitly controlled in the functions that create the
rows in question. This regression was introduced in commit 3d177b67
(display: Don't use gtk_widget_show_all).
As the main headerbar used by the shell is split, the title is not
propagated to the window. However, the "apply" header bar is not split
and the title is propagated to the toplevel GtkWindow.
Fix this issue by resetting the window title again.
Fixes https://gitlab.gnome.org/GNOME/gnome-control-center/issues/81
This commit improves the Night Light code in various
ways:
* Turn it into a template class, subclass of GtkDialog,
and adapts all the code to reflect that.
* Update the code style in various places, to make it
more conformant with the documented code style.
* Reorganize the code a bit, moving functions around,
to make it more conformant with the documented order.
This adds the following API:
* cc_display_config_get_ui_sorted_monitors
Returns the monitors in UI order
* cc_display_config_count_useful_monitors
Counts the useful monitors (active and usable)
* cc_display_monitor_is_useful
Checks if a monitor is active and usable
* cc_display_monitor_is_useable
Check if a monitor is marked as useable
* cc_display_monitor_set_usable
Used to mark builtin monitors as unusable if the lid is closed
* cc_display_monitor_get_ui_*
Get the UI number and strings for display
https://bugzilla.gnome.org/show_bug.cgi?id=786971
Remove the code that has become unused with the new arrangement widget.
There are more possible cleanups as there is some code duplication
between cc-display-panel.c and cc-display-arrangment.c at this point.
https://bugzilla.gnome.org/show_bug.cgi?id=786971
This commits adds a new arrangement widget, refactoring the existing
code and addressing a number of issues:
* Forced snapping made laying out more than 2 monitors hard
* Random gaps would be shown between monitors
* The scaling was fixed and usually tiny
https://bugzilla.gnome.org/show_bug.cgi?id=786971
When the user creates temporary invalid configurations the dialog used
to hide the apply button as if no change had been done so far. Change
this to show the normal "Apply"/"Cancel" titlebar but make the "Apply"
button insensitive and modify the title to indicate the error.
Unfortunately we don't currently get the reason in a way that we could
translate it. Ideally we would special case common error scenarios and
present the user with a better explanation or even correct the mistake.
See https://bugzilla.gnome.org/show_bug.cgi?id=790891 for the related
mutter bug.
https://bugzilla.gnome.org/show_bug.cgi?id=790792
The GVariant constructed here would be useless otherwise, since there are
no outputs to show the labels for. Besides, calling g_variant_builder_close
in this scenario would hit an assertion and the program would crash.
https://gitlab.gnome.org/GNOME/gnome-control-center/issues/12
When switching between screen mirroring and joining displays the
configuration needs to be reset. Otherwise the monitor scaling will
not be set back to the current scaling again.
Split out the code to reset the current configuration and call that when
the mode is switched to ensure the changes are minimal.
https://bugzilla.gnome.org/show_bug.cgi?id=790768
The existing modal dialogs are cumbersome to use so let's replace them
with popovers that dismiss themselves automatically when an item is
activated.
https://bugzilla.gnome.org/show_bug.cgi?id=786726
Mutter currently generates 4 scales per integer scale. Knowing that,
we can nicely "round" the values we display to what the ideal scales
are even though the real values might be skewed since mutter creates
scale values close to the ideal ones that yield integer logical sizes.
https://bugzilla.gnome.org/show_bug.cgi?id=786922
One digit isn't enough to distinguish between some modes. We probably
should do better mode filtering and/or grouping but that needs to
happen in mutter.
We rely on visible-child-name notifications to generate the
appropriate UI, unfortunately it doesn't happen for the first added
stack page if the widget is already visible. Work around this by
adding a dummy page first.
gtk_stack_set_visible_child_name() doesn't actually make a child
visible if the child widget isn't visible already which means we'd
always start in the first ("join") stack page even if the currently
applied configuration is one of the others.
https://bugzilla.gnome.org/show_bug.cgi?id=786767
As mutter now has removed the legacy monitor config system and the
associated property on org.gnome.Mutter.DisplayConfig, also remove the
support from gnome-control-center.
https://bugzilla.gnome.org/show_bug.cgi?id=777732
This implements most of the new Display panel re-design by Allan
Day.
Left out for now is brightness setting which still is in the
Power panel because the plumbing layers don't yet associate backlights
with outputs.
Also left out is the presentation mode and trimming of options due to
hardware constraints since we don't have a mutter implementation for
those yet.
https://bugzilla.gnome.org/show_bug.cgi?id=785949