Commit graph

276 commits

Author SHA1 Message Date
Andrea Azzarone
f9b65046e9 night-light-dialog: Ignore G_IO_ERROR_CANCELLED errors
We should ignore G_IO_ERROR_CANCELLED errors and avoid displaying useless
warnings. Also use g_clear_object instead of g_object_unref.

Fixes: https://gitlab.gnome.org/GNOME/gnome-control-center/issues/87
2018-05-12 02:31:12 +00:00
Andrea Azzarone
1d26f63b18 night-ligth-dialog: Avoid dereferencing invalid pointer
dialog_got_proxy_cb and dialog_got_proxy_props_cb may be called after the
instance of CcNightLightDialog has been disposed. Make sure 'self' pointer is
not dereferenced if not valid.

Fixes: https://gitlab.gnome.org/GNOME/gnome-control-center/issues/86
2018-05-10 00:56:19 +02:00
Benjamin Berg
c2f601a9d4 Move common panel code from shell/ to panel/common
This creates a new static library called libwidget which the shell links
against.
2018-04-17 15:26:59 +02:00
Georges Basile Stavracas Neto
cbf0dc99da display: Cache the D-Bus proxy 2018-04-06 22:23:38 -03:00
Benjamin Berg
adf5a42f01 display: Show insensitive apply button for invalid configurations
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
2018-03-29 12:09:59 +02:00
Mohammed Sadiq
f6b3afb9d2 display: Increase popover margins to match mockup
https://bugzilla.gnome.org/show_bug.cgi?id=793165
2018-03-16 02:32:55 -03:00
Mario Sanchez Prada
ca9228bb59 display: Early return in monitor_labeler_show() if no outputs are available
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
2018-03-14 23:27:44 +00:00
Piotr Drąg
7265bd53a0 Add translator comments to .desktop files
Icons are confusing translators, and gettext
is unlikely to get fixed any time soon.
2018-02-23 18:49:35 +01:00
danielps
77aaf3146b display: Fix night light minute selection
The night light schedule dialog stores the time as a single floating
point value, which is then converted into hours and minutes for the
time selection fields.

Previously, the minutes were calculated using the remainder of the
stored value and the hours. This caused undesired behaviour when the
hour field was set to zero, as fmod(value, 0) returns NaN. As a result,
the user was not able to set the time between 00:00 and 00:59.

This patch rewrites the time retrieval logic using modf.

https://bugzilla.gnome.org/show_bug.cgi?id=792944
2018-01-30 09:38:11 -02:00
Iñigo Martínez
0dd386f405 build: Migrate from Intltool to Gettext
Recent versions of Gettext are able to translate several formats
that are used in GNOME applications. This patch migrates from
Intltool to Gettext by using meson's i18n features.

https://bugzilla.gnome.org/show_bug.cgi?id=787588
2018-01-23 10:49:31 +01:00
Rui Matos
1fe3f5c5fe display: Add support for mutter's global scale requirement
If mutter requires the same scale on all logical monitors we must
propagate a scale set on one monitor to the remaining ones or we'll
fail validation leaving users wondering why it doesn't work.

https://bugzilla.gnome.org/show_bug.cgi?id=790809
2018-01-21 12:24:54 -02:00
Iñigo Martínez
dc0988d47c build: Remove autotools
To avoid the burden of maintaining multiple build systems, this
patch removes autotools support.

https://bugzilla.gnome.org/show_bug.cgi?id=785414
2018-01-18 12:20:08 +01:00
Piotr Drąg
b65e31323a panels: Remove soft hyphens from .desktop files
With the old shell gone, there is no need to work around cut off panel
names (bug #647087). As it stands now, it only confuses translators
(invisible characters are hard to, well, see).

https://bugzilla.gnome.org/show_bug.cgi?id=792629
2018-01-18 00:12:04 -02:00
Iñigo Martínez
32edd6789e build: Port to meson build system
Meson is a build system focused on speed an ease of use, which
helps speeding up the software development. This patch adds meson
support along autotools.

https://bugzilla.gnome.org/show_bug.cgi?id=785414
2018-01-17 20:09:35 -02:00
Benjamin Berg
3f3c4bed87 display: Reset configuration when switching layouting modes
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
2017-12-08 16:09:58 +00:00
Elias Entrup
154101448a display: Wrap frame subtitle label
Currently, the display window is very wide due to the subtitle label.
This patch adds line wrapping to the label and sets xalign to 0.

https://bugzilla.gnome.org/show_bug.cgi?id=790449
2017-11-16 18:07:40 +01:00
Rui Matos
cc329621e2 display: Ignore disabled and closed builtin panels in layout geometry
Extend the existing checks for this kind of outputs to the layout
geometry routines.

https://bugzilla.gnome.org/show_bug.cgi?id=789711
2017-11-15 15:10:15 +01:00
Rui Matos
245f796f4a display: Remove automatic layout adjustments
As the comment hinted at, fixing layouts automatically to ensure their
applicability doesn't actually work in all cases and in fact may force
users to redo their layout completely after a seemingly small change.

So, let's stop pretending we can do it and instead leave it to users
to fix it manually.

https://bugzilla.gnome.org/show_bug.cgi?id=789711
2017-11-13 18:31:39 +01:00
Rui Matos
46c2d43e62 display: Replace modal dialogs with popovers
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
2017-11-10 17:34:57 +01:00
Rui Matos
23d5ea29aa display: Round the displayed scale values logically
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
2017-08-28 18:58:05 +02:00
Rui Matos
bbccf27488 display: Simplify scale filtering
This is prone to miss intermediate values that users might actually
want to use so, for now, just show the 5 first scales.
2017-08-28 18:58:05 +02:00
Rui Matos
a4a243cee4 display: Round scaled logical monitor sizes the same way mutter does
Mutter uses round() while we are just truncating via the implicit
double -> int type conversion, meaning that mutter will reject some
configurations that should work. Fix that by using the same rounding
as mutter.

https://bugzilla.gnome.org/show_bug.cgi?id=786919
2017-08-28 18:58:05 +02:00
Rui Matos
7ed4efef50 display: Show refresh rates with two digits after the radix
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.
2017-08-25 16:49:02 +02:00
Rui Matos
6a9274a165 display: Don't show inactive monitors in the arrangement widget
Inactive monitors are not part of the configuration global geometry,
i.e. they don't have a position set, so it doesn't make sense to show
them.
2017-08-25 16:49:02 +02:00
Rui Matos
dae238cc5f display: Avoid crashing when a monitor doesn't have a mode set
In this case just avoid showing information we don't have.
2017-08-25 16:49:02 +02:00
Rui Matos
337802315c display: Ensure we generate the UI initially on two output mode
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.
2017-08-25 16:49:02 +02:00
Rui Matos
6c4eb9fc86 display: Fix the two output UI to start with the current configuration
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
2017-08-25 15:17:12 +02:00
Rui Matos
57a82a89cd display: Cancel pending changes on Escape key press 2017-08-23 18:32:28 +02:00
Rui Matos
566d2cf6ac display: Add mnemonics to Cancel and Apply buttons 2017-08-23 18:32:28 +02:00
Rui Matos
a8071322a7 display: Move scale row above refresh rate
It's a bit closer to the mockups, in spirit at least.
2017-08-23 18:32:28 +02:00
Rui Matos
566b0c137c display: Make rows created for a new current output be the same size
We need the rows size group to exist when creating output UIs.
2017-08-23 18:32:27 +02:00
Rui Matos
0a0ac31b51 display: Handle lid being closed a bit better
If the lid is closed we shouldn't allow the builtin display to be
configured.
2017-08-23 18:32:27 +02:00
Rui Matos
088f35617c display: Make scale row be the same height as others 2017-08-23 18:32:27 +02:00
Rui Matos
e5a1afee9c display: Fix a crash when opening the panel with the lid closed
The configuration manager might not be ready yet when we're called
from the lid state monitor handler. Don't do anything in that case.

https://bugzilla.gnome.org/show_bug.cgi?id=786080
2017-08-22 19:26:39 +02:00
Rui Matos
ef0cbf45f3 display: Make arrangement and scale rows non-activatable 2017-08-22 19:21:41 +02:00
Rui Matos
47919bcfb1 display: Fix underscanning switch [de]activating the output instead 2017-08-22 19:21:41 +02:00
Rui Matos
7c7c0b75d5 display: Switch to a toggle buttons design for scale
The slider design wasn't fit for this since we allow only a finite set
of scales.
2017-08-22 19:21:41 +02:00
Rui Matos
c50062a48b display: Update the two display mode switcher design
This makes us follow the updated design mockups more closely.
2017-08-22 19:21:41 +02:00
Rui Matos
90cf23a70a display: Redraw the arrangement area widget when outputs change
This ensures the arrangement area always reflects the current
changes.
2017-08-22 19:21:41 +02:00
Rui Matos
e4dc2995a3 display: Add a signal for scale changes
This will allows other bits of the UI to monitor scale changes.
2017-08-22 19:21:41 +02:00
Rui Matos
52d61d52b2 display: Force content to always have a fixed minimum width
This makes switching between configurations and/or active monitor look
a bit more polished.
2017-08-21 14:47:17 +02:00
Rui Matos
d0ca7e0abc display/config-manager-dbus: Clear the current state on error
This ensures that the higher levels notice that there was an error and
show the appropriate UI instead of showing the previous state.
2017-08-21 14:47:17 +02:00
Rui Matos
93a3bbe0fc display: Remove a few no longer needed variables
These are not needed since last commit.
2017-08-21 14:47:17 +02:00
Jonas Ådahl
ff30244c5c panels/display: Remove support for old config system
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
2017-08-21 12:33:38 +08:00
Rui Matos
c0f686bb0f display: Re-design the panel
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
2017-08-09 19:27:08 +02:00
Rui Matos
353236b576 display-config-dbus: Consider interlaced flag for similar modes
Otherwise we could end up picking an interlaced mode when we want a
non-interlaced one or vice-versa since they might have equal
refresh rates.

https://bugzilla.gnome.org/show_bug.cgi?id=785949
2017-08-09 19:27:08 +02:00
Rui Matos
7c89e30a47 display: Add some signals to the new configuration API
These will be useful to keep track of changes across different places
in the new UI.

https://bugzilla.gnome.org/show_bug.cgi?id=785949
2017-08-09 19:27:08 +02:00
Rui Matos
9b0cf3391c display: Refactor night light widget instantiation
We'll need multiple instances of this widget in the new panel
design. This makes it possible.

https://bugzilla.gnome.org/show_bug.cgi?id=785949
2017-08-09 19:27:08 +02:00
Jonas Ådahl
c37ce6fcb4 display: Add is_interlaced() D-Bus implementation
Whether a mode is interlaced or not is now exported by adding a
'is-interlaced' (b) value to the mode properties variant. Implement the
is_interlaced() vfunc using this information.
2017-07-14 18:32:55 +02:00
Jonas Ådahl
252fd31762 display: Update to the new D-Bus API mode format
The mode format communicated via the new D-Bus API changed to
specifying modes using a per monitor unique mode ID string. The uint
'flags' was also changed to more flexible a{sv} 'properties' structure.
2017-07-14 18:32:55 +02:00