Commit graph

5603 commits

Author SHA1 Message Date
Robert Ancell
a856740dfa applications: Fix wrong IDs being passed to portal permission store
There were two cases of the app ID being used instead of the Flatpak ID.
2019-03-20 17:07:45 +00:00
Benjamin Berg
b26a8bdeed display: Ensure configuration has the expected type
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
2019-03-20 18:01:01 +01:00
Benjamin Berg
f45dcff81f display: Ensure at least one display is enabled
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.
2019-03-20 18:01:01 +01:00
Benjamin Berg
defbcebfab display: Simplify configuration type and UI selection logic
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).
2019-03-20 18:01:01 +01:00
Benjamin Berg
b2f1d489ad display: Add unusable monitors to dropdown and disable switch for them
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.
2019-03-20 18:01:01 +01:00
Benjamin Berg
e387b3bb86 display: Only enforce single mode when desired by UI
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.
2019-03-20 18:01:01 +01:00
Benjamin Berg
98d20659b7 display: Make rebuilding variable a counter
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.
2019-03-20 17:58:29 +01:00
Benjamin Berg
21bb6416be display: Reset resolution when switching configuration types
It generally makes more sense to reset the resolution of a monitor after
we switch configuration types. The main case where this is relevant is
switching from a mirror configuration (CLONE) to either join or single.
In this case, higher resolutions for monitors may become available.

Note that this might be annoying to some users, because there may be
monitors reporting a lower "preferred" resolution than the highest
supported resolution. There is little we can do though, as always
selecting the highest resolution doesn't seem like a much better
approach.
2019-03-20 17:26:56 +01:00
Benjamin Berg
ae22f72cac display: Prevent error when serializing invalid configuration
If no monitors are enabled, then the variant would end up with an
invalid variant type, causing a crash later on. This case only happened
due to other bugs (i.e. in principle we should never send a
configuration without any monitors to the server).

Prevent the serialization error by specifying the correct type for the
builder, therefore potentially preventing a crash in such a corner case.
2019-03-20 17:26:56 +01:00
Benjamin Berg
0c4e84e417 display: Ensure we have a primary monitor after all were disabled
When enabling the first monitor, we need to select it as primary as we
otherwise end up without a primary monitor (rendering the configuration
invalid). "Unsetting" the NULL primary monitor effectively causes the
first and only available monitor to become the primary, while not doing
anything if we have a primary monitor.
2019-03-20 17:26:08 +01:00
Benjamin Berg
20d24992ee display: Enable all monitors when switching to join config
The new code had a bug in that it only ever enabled the first monitor
rather than all usable ones. Fix this by removing the erroronuous break.
Also clarify the comment a bit that the current solution is not really
ideal as it may result in invalid configurations (i.e. we enable more
outputs than are possible with the number of available CRTCs).

Fixes #418
2019-03-18 17:08:35 +00:00
Robert Ancell
29eebceddd applications: Fix flatpak ID memory leak 2019-03-18 14:53:43 +00:00
Marco Trevisan (Treviño)
49957ef818 display: Don't always set the primary monitor to the first in list
As per the binding that we have between the list store and the combo-box, when
the first element is added to the list-store, the combo box set this value as
the selected-index, and this leads to a call to cc_display_monitor_set_primary
which set the first-listed monitor as primary and unset the real primary monitor.

To avoid this, just ignore the binding when rebuilding the UI, since in this
phase control-center should just reflect the actual state without changing
anything.

Fixes https://gitlab.gnome.org/GNOME/gnome-control-center/issues/419
2019-03-18 11:53:18 +00:00
Robert Ancell
82ca937ecd sound: Fix crash when sound device set to NULL
This can occur during transitions.

Introduced in f081264.
2019-03-14 11:28:08 +13:00
Robert Ancell
f0812644ae sound: Apply device changes
Was missing the code to actually apply the changes.
2019-03-14 10:58:59 +13:00
Ondrej Holy
743677c560 info: Remove unused gsd-disk-space-helper.[h|c]
GNOME/gnome-control-center!387 ported info panel to use UDisks2 instead
of GUnixMounts and thus the helpers from gsd-disk-space-helper.[h|c] are
no more needed.
2019-03-13 16:04:58 +01:00
Felipe Borges
ef73a423d7 online-accounts: Add shadow to providers icon
The new icons are flat and are more legible with a shadow, just
like the new GNOME application icons.

See https://gitlab.gnome.org/GNOME/Initiatives/issues/2
2019-03-13 13:47:34 +01:00
Felipe Borges
de769bbe9b sound: Add shadow to application icons
The new GNOME application icons need a shadow when placed on top
of a light background.

See https://gitlab.gnome.org/GNOME/Initiatives/issues/2
2019-03-13 13:46:53 +01:00
Felipe Borges
7e17e308af notifications: Add shadow to application icons
The new GNOME application icons need a shadow when placed on top
of a light background.

See https://gitlab.gnome.org/GNOME/Initiatives/issues/2
2019-03-13 13:46:23 +01:00
Felipe Borges
46ad696890 search: Add shadow to application icons
The new GNOME application icons need a shadow when placed on top
of a light background.

See https://gitlab.gnome.org/GNOME/Initiatives/issues/2
2019-03-13 13:45:59 +01:00
Felipe Borges
4e34738cbb applications: Add shadow to application icons
The new GNOME application icons need a shadow when placed on top
of a light background.

See https://gitlab.gnome.org/GNOME/Initiatives/issues/2
2019-03-13 13:45:26 +01:00
Benjamin Berg
37c768ab0f display: Fix Apply button showing for changes to disabled monitor
Disabled monitors may or may not have a mode selected. This means, we
need to skip the mode comparison if the two compared monitors are
disabled (i.e. have no logical monitor).
Move the mode check to the end and skip it if both monitors are disabled.

This fixes cases where identical configurations are misdetected, because
we applied a mode to a monitor and disabled the monitor again. This
happens for example when switching the active monitor in "single" mode.
2019-03-11 18:32:21 +00:00
Benjamin Berg
1f29dad46f display: Keep current monitor enabled when forcing an update
In the case where the user plugged/unplugged a screen, we could run into
the case where we would first enable and then disable the same output.
This could potentially result in an invalid configuration.

Prevent this by not disabling the output if no switch happened.
2019-03-11 18:32:21 +00:00
Benjamin Berg
75bf1b8cd1 display: Update apply button when switching output in "single" mode
While the configuration was updated, the apply button was not synced.
This meant users could not switch the active monitor properly.

Fixes #405
2019-03-11 18:32:21 +00:00
Benjamin Berg
5aa17c6984 display: Correctly select "single" mode when opening display panel
The dialog tried to retain the current configuration mode. However,
doing so means that we end up in the wrong mode in some situation (e.g.
opening the dialog with two displays but only one enabled).

Fix this by always selecting a configuration mode. This potentially
switches the user from "join" to "single" if only one monitor is left.
However, the user has no way to do this manually, so no unexpected UI
change will happen.
2019-03-11 18:32:21 +00:00
Robert Ancell
0f257d2451 applications: Add missing creation of cancellable 2019-03-11 18:24:59 +00:00
Benjamin Berg
42006249af Remove internal copy of HdyValueObject
The relevant code is included in libhandy 0.8 and can be removed now
that we depend on a new enough version.
2019-03-04 16:59:25 +00:00
Andrea Azzarone
f42f39970d user-accounts: Fix memory corruption in the avatar popup
Use g_object_set_data_full and g_steal_pointer to ensure the validity of the
"filename" association.

Closes: https://gitlab.gnome.org/GNOME/gnome-control-center/issues/399
2019-03-04 11:06:54 +00:00
Ondrej Holy
03bf65f78f user-accounts: Remove custom file size limit for avatars
accountsservice has 1 MB limit for avatars, however, users panels
refuses to show avatars bigger than 64 KB for some historical reasons.
But you can still successfully set avatars up to the accountsservice
limit. Let's remove this custom limit and other redundant check and
rely just on accountsservice limits and errors from GDK.

https://bugzilla.gnome.org/show_bug.cgi?id=792243
2019-03-02 14:47:52 +00:00
Ondrej Holy
addc65a6fd user-accounts: Allow bigger custom avatars
Default set of avatars uses 512x512 currently. However, custom avatars
from file, or webcam are always scaled down to 96x96. Let's increase this
also to 512x512. This change should be safe, because theoretical maximal
file size is 1 MB, which is equal to accountsservice limit.

https://bugzilla.gnome.org/show_bug.cgi?id=792243
2019-03-02 14:47:52 +00:00
Benjamin Berg
e786b5a767 display: Mark "Scale" label as translatable
These strings were not marked as translatable when the panel was ported
to use templates.

Follow up for 9fba7cc2
2019-02-27 10:39:51 +00:00
Benjamin Berg
bec0f5f588 printers: Add context to Resolution printing option
For now, this patch only adds the context to the Resolution option to
disambiguate it from the display panel. This makes the code more complex
though, and will be changed again to add the context to all options
(making the strings identical to the ones in GTK+).

Fixes #394 for the printing panel
2019-02-26 19:42:13 +01:00
Benjamin Berg
c4d60b9d1d display: Add context to display setting strings
Note that no context is added for "Refresh Rate" and "Adjust for TV" at
least for now.

Fixes #393
2019-02-26 19:40:07 +01:00
Bastien Nocera
9fba7cc2ad display: Mark strings as translatable
Those were translatable before the "templating" of this section of the
panel.

Fixes: 8503dab5
2019-02-26 18:54:14 +01:00
Benjamin Berg
638f2065a5 display: Do not expand display enabled switch
Fixes #367
2019-02-22 13:44:39 +00:00
Robert Ancell
3ccdd42b95 thunderbolt: Remove unused no_show_all properties
The gtk_widget_show_all calls were removed in d2ae2d4
2019-02-19 15:24:00 +01:00
Adrien Plazas
b181fccc8b region: Slide the restart revealer up
This direction is more natural given the layout.
2019-02-19 13:38:13 +00:00
Adrien Plazas
f02255090d region: Make the rows adaptive
Align the sizing of the rows on the one of HdyActionRow and ellipsize
the labels to make the panel better fit in narrow windows.
2019-02-19 13:38:13 +00:00
Adrien Plazas
e75cf5b643 region: Make CcInputRow adaptive
Align the sizing of the CcInputRow on the one of HdyActionRow and
ellipsize its labels to make it better fit narrow windows.
2019-02-19 13:38:13 +00:00
Adrien Plazas
8cb75c45a3 region: Stabilize the size of the Input Sources button
This avoids the button's size to jump as its surrounding box's size
changes because of the description label taking more or less lines.
2019-02-19 13:38:13 +00:00
Adrien Plazas
fa76b5e7e8 region: Wrap the Input Sources description
This allows the panel to reach smaller sizes.
2019-02-19 13:38:13 +00:00
Adrien Plazas
71b049951a region: Adapt the indentation
This adapts the indentation of the children of HdyColumn, which were
deliberately left intact in the previous commit to make it more
readable.
2019-02-19 13:38:13 +00:00
Adrien Plazas
23e85b6c8b region: Use a HdyColumn and a GtkScrolledWindow
Put the widget's content into a HdyColumn, itself into a
GtkScrolledWindow. This allows the panel to reach narrower sizes.

This deliberately doesn't adapt the indentation of the contained widget
to help this commit to be more readable and easier to review, it will be
adapted in the next commit.
2019-02-19 13:38:13 +00:00
Adrien Plazas
0a249441af wifi: Wrap the airplane mode description
This will help the panel fit in narrower windows.
2019-02-19 13:28:37 +00:00
Adrien Plazas
dd3c47de27 info: Ellipsize the default app choosers
This allows the Default Applications panel to reach nrrower widths.
2019-02-19 13:35:59 +01:00
Iain Lane
39e31e912f
privacy: Remove {get,set}_on_off_label2
There's only one instance of this pattern - make the function specific
to that case rather than generic.

The current code is leaking the Label2Data struct and the GSettings
signal connection. The leak of the signal connection was causing a crash
in case the callback was called after the label was destroyed. Instead
of just directly fixing these problems, let's eliminate the intermediate
struct and just support the specific case we're interested in directly.
2019-02-19 11:04:07 +00:00
Adrien Plazas
c74d28009c sound: Make the panel adaptive
Use a HdyColumn and ellipsize same labels so the panel can fit in
narrower windows.
2019-02-18 15:12:53 +01:00
Georges Basile Stavracas Neto
2520aea647 info: use UDisks to retrieve disk size
The current code relies on GLib API and uses the
available mounts to calculate the available partition
size. This is because this code assumes that more
than one OS can be installed in the same drive, and
wouldn't make sense to show the whole disk size in
this situation.

That, however, clashes with the general purpose of
the panel, for it is meant to show general information
about the user's computer, and it is not reporting
the full disk size.

Fix that by using the UDisks API to get the real size
of the full disks.

https://bugzilla.gnome.org/show_bug.cgi?id=639376

Slighly modified by Iain Lane <iainl@gnome.org> to
port to meson and add udisks2 to CI deps.

Fixes #285.
Fixes #302.
2019-02-13 17:04:26 +00:00
Georges Basile Stavracas Neto
cd0954be34 user-accounts: Ellipsize real name label
In the User Accounts panel's carousel, longer real names
push the window geometry to super wide levels -- even with
the 255-char limitation in place.

Fix that by ellipsizing the real name label.
2019-02-13 15:06:53 +00:00
Georges Basile Stavracas Neto
db94f197fa user-panels: Limit full name length
GNOME Settings allows limitless full names, which is
actually accepted by most of the stack but may break
GNOME Settings, GNOME Shell and other user-visible
applications that show the user names.

Limit the user full name entries to 255 characters,
which is the same value used by GNOME Initial Setup.
2019-02-13 15:06:53 +00:00