The CcWifiHotspotDialog is derived from GtkDialog, which is floating.
The floating reference is destroyed on closing the main window, before
the NetDeviceWifi is disposed. This causes a critical warning when the
NetDeviceWifi dispose does run, since it tries to destroy a now
non-existent window.
Fix this by sinking the floating reference, and unreffing it in the
NetDeviceWifi dispose function.
Fixes#2823
Row subtitles in Settings are typically a description of the main label or setting.
You can see this in Mouse & Touchpad, Privacy, Sharing, and Wi-Fi.
For the System panel we did something a bit different and used the subtitle to show
the status of each panel.
Given the standard use of subtitles elsewhere, this feels a bit surprising which,
as a result, makes the panel harder to read. I think that a standard description
would probably also be more useful than the current labels.
Mockups https://gitlab.gnome.org/Teams/Design/settings-mockups/-/blob/master/system/system-panel.png?ref_type=heads
This also removes the thin CcSystemPage abstract class because it was
only introduced to add the support for dynamic System row subtitle. Now
this abstraction is no longer necessary.
Fixes#2776
In !2051, we switch back to real locale before setting the label text,
however, according to nl_langinfo's manpage, the returned pointer could
be invalid after switching locale or creating new locale, so the program
may crash.
To fix this, we save the result before switching locale, so we won't
access the invalid pointer after switching locale.
The GtkScrolledWindow-AdwClamp-GtkBox combo would cause the dialog to horizontally move when the user resizes it to its minimum width. Furthermore, the AdwClamp used in the window wasn't using its `child` property. The dialog looks identical.
Now that our first and last configuration points are 0/100 and 100/0
respectively, we can simplify the calculation a bit. Doubly so because
p2 is just a mirror of p1.
That with extending the slider range to 200 means we get a value for
each integer combination on our pressurecurves - which in turn means
that for any of our generated curves we get a slider value return.
Our previously hardcoded pressurecurves follow a predictable
pattern so we can generate the value on-the-fly based on that pattern.
The slider now uses a range of 100 (integer) values and calculates the
matching pressure curve based on that. The actual pressure curve remains
the same for previous values.
However, the functions are lossy thanks to CLAMP() so figuring out
a slider position from points requires heuristics: for each of the four
coordinates we calculate a slider value. Then we calculate the points
for that slider value and if those calculated points match ours then we
have a winner.
This code does not work as expected in X11, since the GdkDevice
that GTK gives us is the Virtual core pointer, and not the hardware
device that is driving it at the moment.
Since there's no way to ask for this information to GTK4, query
XI2 indirectly about it, by checking the source device that the
Virtual core pointer inherited its XIValuatorClass classes from
(e.g. pressure), then querying that source device /dev node path.
This uses a work around AdwBanner not having APIs for setting a
custom child on its internal GtkOverlay child.
It adds a custom widget (CcListRowInfoButton) using the GtkWidget
API and binds the widget visibility to the AdwBanner.visible
property.
This workaround ignores AdwBanner.revealed and relies on its
"visible" property so that we avoid having a "hide" animation when
switching between an app that shows the banner to one that doesn't.
An app page is static populated and the banner is supposed to be
displayed when the page loads and not later.
Fixes#2782
The ability to choose solid colored backgrounds has been removed at
least 4 years ago, so let's remove the code for it too.
Furthermore, we slightly refactor some code to make it easier to
understand and fit better to the usual style.
Because the CcBackgroundPaintable is now reusable, it can be used inside
the preview. This allows removing lots of code, since the drawing is now
done by the paintable. Because the scale factor was previously not
handled properly, this change makes the preview much sharper on scale
factors > 1.
Fixes#704
To make the CcBackgroundPaintable fully reusable, it has to know the
desired thumbnail size and the thumbnail factory. We add a width and
height property, and modify the thumbnail retrieval of CcBackgroundItem
to use the scale factor now.
This also allows us to greatly simplify the background sources, so that
they now only do one thing: provide CcBackgroundItems from different
sources.
We keep the fixed thumbnail height and width for the chooser, which
makes more sense now that it is in the chooser code instead of the
background source code.
In order to make the CcBackgroundPaintable more reusable, the way it
draws itself either light, dark, or both needs to be adjustable. We
therefore introduce CcBackgroundPaintFlags that indicate the desired
drawing behavior.
Similar to the previous crashes, if you switch panels after forgetting a
network while the toast is still alive, Settings crashes. This is
because the AdwToastOverlay is not properly disposed because the Saved
Networks dialog is also not destroyed.
However, destroying the saved networks dialog still leaves a crash,
because the overlay disposal first unreferences its child, but we still
need that for the dismissal of the waiting toasts. Therefore, we keep an
extra reference to the saved networks list.
To prevent further crashing, we cannot set "list" to NULL, because there
may be multiple async calls. Also, we have to keep a reference to self
in the async call, otherwise it does not work when you remove many
networks and then switch panels.
As an added bonus, we can now use the saved networks list inside the UI
refresh function.
It is cleaner to define the dialog in a .ui file. Moreover, since we are
initializing the main Visible Networks list in the code, we can
initialize the Saved Networks list in the same location, in the same
style.
When a network is forgotten from the Saved Networks dialog and the
dialog is closed, the toast remains active. However, when you then
quickly reopen the dialog, a new CcWifiConnectionList gets made, which
causes a crash when the toast expires or is dismissed, as the row for
the toast has now become invalid.
Fix this by only setting up the CcWifiConnectionList for saved networks
once.
When forgetting more than one network from the Saved Networks dialog,
there are multiple overlapping toasts. When the first toast expires or
is dismissed, the underlying CcWifiConnectionList is already thawed,
meaning previous rows get cleaned up and new ones generated. When the
next toast then expires or is dismissed, this results in a crash, as the
row belonging to that toast is now invalid.
Fix this by freezing the connection list earlier.
Fixes#2793
Move the page description to AdwPreferencesPage, since
it's the correct place to put the page description.
Also, set up the page description in the C code to
help translators.
- Use the up-to-date style for symbolics (2px outline). Notifications, Printers and Info/About
work fine as outlines.
- filled silouehette symbolic are only to be used where a 2px outline is impossible
to cram to 16x16px canvas.
Some applications have symlinks that point outside of their folder
in their cache/data directories, leading to incorrect, slower
measurements. Namely, Builder has a symlink to the home directory
in its cache folder, which also contains the Builder app directory,
creating recursion and (very) wrong measurements.
By adding the `FTW_PHYS` flag to the function that traverses the
directory and measures folder size, symlinks are ignored.
Closes#2375
Fix many warnings of the shape:
warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
Consequence of casting the pointers during g_clear_pointer
The current system related entries are ambiguous, as it isn't clear
what the actual notifications are.
System services should handle their own notification settings
instead.
Fixes#527Fixes#1175
Row subtitles in Settings are typically a description of the main label or setting.
You can see this in Mouse & Touchpad, Privacy, Sharing, and Wi-Fi.
For the System panel we did something a bit different and used the subtitle to show
the status of each panel.
Given the standard use of subtitles elsewhere, this feels a bit surprising which,
as a result, makes the panel harder to read. I think that a standard description
would probably also be more useful than the current labels.
Mockups https://gitlab.gnome.org/Teams/Design/settings-mockups/-/blob/master/system/system-panel.png?ref_type=heads
This also removes the thin CcSystemPage abstract class because it was
only introduced to add the support for dynamic System row subtitle. Now
this abstraction is no longer necessary.
Fixes#2776
- Use AdwStatusPage
- Use .pill and .suggested-action style classes in
the button from airplane mode status page
And use valign=center, otherwise AdwStatusPage
won't be vertically centralized.
So that the main switch and the page summary are updated when the
backend changes.
With this, the UI reacts to external calls such as
`grdctl rdp enable`.
The Remote Desktop page subtitle was updated asynchronously when
the System panel was loaded but after the following steps:
1. Connection established to `org.gnome.SettingsDaemon.Sharing`
(handled on `sharing_proxy_ready`).
2. Then a check whether Remote Desktop is available by watching
the `org.gnome.Mutter.RemoteDesktop` bus name appear.
3. Then we are finally populating the UI (and updating the
subtitle).
Now we bypass the panel initialization and check directly for the
"enable" state of the backend GSetting and the availability of the
gnome-remote-desktop.service, using `is_remote_desktop_enabled()`.
Fixes#2772
Commit ef644deb made the routes labels for the IPv4 and IPv6 center
properly. However, when stretching the dialog, this centering is lost
because the labels do not horizontally expand.
So let's make all of them horizontally expand.