Commit graph

6549 commits

Author SHA1 Message Date
Sebastian Keller
b3a7a16d23 keyboard: Use gtk4 translations instead of gtk3 ones for shortcut search
Otherwise looking up shortcuts with "ctrl" in non-English locales would
fail without gtk3 installed.

Fixes: https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1546
2021-12-17 19:27:03 +01:00
Colin Watson
14a2672e28 datetime: Fix handling of Irish timezone on map
The timezone map tries to highlight regions of the world that keep the
same time, approximating this by their non-daylight-savings UTC offset.
There's no reasonable API for this, and it goes wrong in various cases,
such as Irish Standard Time which is legally defined as the country's
summer time with a negative DST offset in winter.

Hardcoding this is unpleasant, but there doesn't seem to be a better
solution, and in any case there's already similar hardcoding implied by
the segmented map images in panels/datetime/data/timezone_*.png.  I've
tried to make it practical to fix other similar disagreements between
the detected offset and the groupings implied by map images, though for
now I've conservatively fixed only the case I'm familiar with.

Fixes: #1341
2021-12-17 14:49:24 +00:00
Colin Watson
1b874509a4 datetime: Remove tzname_daylight
The code that set it could only ever have worked by luck in some
timezones on some systems, and there's no API to obtain the information
we were trying to store in it.  Nothing uses it, so there's no point
trying to fix it.

tzname_normal is also unused, but slightly useful for debugging, so
rename it to tzname but otherwise keep it in place.
2021-12-17 14:48:45 +00:00
Victor Toso
8355404ed4 keyboard-shortcut-editor: fix leak of accel string
==31571== 120 bytes in 8 blocks are definitely lost in loss record 17,034 of 19,290
==31571==    at 0x484086F: malloc (vg_replace_malloc.c:380)
==31571==    by 0x4AF77A8: g_malloc (gmem.c:106)
==31571==    by 0x4D9816A: gtk_accelerator_name (gtkaccelgroup.c:1577)
==31571==    by 0x4A82D1: setup_custom_shortcut (cc-keyboard-shortcut-editor.c:364)
==31571==    by 0x4A92DF: cc_keyboard_shortcut_editor_key_press_event (cc-keyboard-shortcut-editor.c:745)
2021-12-17 09:53:41 +01:00
Victor Toso
365fb19957 keyboard-item: fix leak on unused CcKeyCombo
==31571== 288 bytes in 24 blocks are definitely lost in loss record 18,138 of 19,290
==31571==    at 0x484086F: malloc (vg_replace_malloc.c:380)
==31571==    by 0x4AF77A8: g_malloc (gmem.c:106)
==31571==    by 0x4A4119: variant_get_key_combos (cc-keyboard-item.c:475)
==31571==    by 0x4A41FD: settings_get_key_combos (cc-keyboard-item.c:498)
==31571==    by 0x4A46BE: cc_keyboard_item_load_from_gsettings (cc-keyboard-item.c:574)
==31571==    by 0x4A5BBB: append_section (cc-keyboard-manager.c:315)
==31571==    by 0x4A605D: append_sections_from_file (cc-keyboard-manager.c:431)
==31571==    by 0x4A6766: reload_sections (cc-keyboard-manager.c:568)
==31571==    by 0x4A6D68: cc_keyboard_manager_load_shortcuts (cc-keyboard-manager.c:707)
==31571==    by 0x4A2FA4: cc_keyboard_shortcut_dialog_init (cc-keyboard-shortcut-dialog.c:841)
==31571==    by 0x4A7A288: g_type_create_instance (gtype.c:1929)
==31571==    by 0x4A61CAC: g_object_new_internal (gobject.c:1945)
2021-12-17 09:53:41 +01:00
Victor Toso
7741dc1abe keyboard-manager: fix leak of section list store
==25729== 1,058 (40 direct, 1,018 indirect) bytes in 1 blocks are definitely lost in loss record 20,104 of 20,657
==25729==    at 0x484086F: malloc (vg_replace_malloc.c:380)
==25729==    by 0x4AF77A8: g_malloc (gmem.c:106)
==25729==    by 0x4B0F1E4: g_slice_alloc (gslice.c:1072)
==25729==    by 0x4B09060: UnknownInlinedFun (gsequence.c:1609)
==25729==    by 0x4B09060: g_sequence_insert_before (gsequence.c:527)
==25729==    by 0x4ED2FE7: gtk_list_store_insert (gtkliststore.c:1271)
==25729==    by 0x4A5DCE: append_section (cc-keyboard-manager.c:363)
==25729==    by 0x4A605D: append_sections_from_file (cc-keyboard-manager.c:431)
==25729==    by 0x4A6766: reload_sections (cc-keyboard-manager.c:568)
==25729==    by 0x4A6D33: cc_keyboard_manager_load_shortcuts (cc-keyboard-manager.c:706)
==25729==    by 0x4A2FA4: cc_keyboard_shortcut_dialog_init (cc-keyboard-shortcut-dialog.c:841)
==25729==    by 0x4A7A288: g_type_create_instance (gtype.c:1929)
==25729==    by 0x4A61CAC: g_object_new_internal (gobject.c:1945)
2021-12-17 09:50:57 +01:00
Victor Toso
dac8fd64cd common: Fix leak of GUdevDevice
The add_device() check for g_udev_device_get_parent() was leaking (see
below). As this is actually used in create_device(), I'm passing it as
argument to avoid a second call to that function.

 > 34,175 (1,080 direct, 33,095 indirect) bytes in 27 blocks are definitely lost in loss record 19,729 of 19,758
 >    at 0x4A7A337: g_type_create_instance (gtype.c:1907)
 >    by 0x4A61CAC: g_object_new_internal (gobject.c:1945)
 >    by 0x4A62C7C: g_object_new_with_properties (gobject.c:2114)
 >    by 0x4A63780: g_object_new (gobject.c:1785)
 >    by 0x5EA5A6A: _g_udev_device_new (gudevdevice.c:132)
 >    by 0x4B6D24: add_device (gsd-device-manager.c:447)
 >    by 0x4B6FBF: gsd_device_manager_init (gsd-device-manager.c:517)
 >    by 0x4A7A288: g_type_create_instance (gtype.c:1929)
 >    by 0x4A61CAC: g_object_new_internal (gobject.c:1945)
 >    by 0x4A62C7C: g_object_new_with_properties (gobject.c:2114)
 >    by 0x4A63780: g_object_new (gobject.c:1785)
 >    by 0x4B7075: gsd_device_manager_get (gsd-device-manager.c:533)
2021-12-17 09:50:57 +01:00
Christopher Davis
897c641549 panels: Replace .view.frame with .boxed-list 2021-12-16 16:32:21 -08:00
Christopher Davis
981a8cea7b panels: Use .boxed-list instead of .content
The `.content` style class is deprecated in favor
of the `.boxed-list` style class, which is named
after the design pattern it's used for.
2021-12-16 12:52:44 -08:00
Michael Catanzaro
c180aa660c network: fix critical when opening VPN details page
I was seeing this critical when opening the VPN details page:

(gnome-control-center:78888): nm-CRITICAL **: 16:26:21.689: ((src/libnm-client-impl/nm-device.c:1299)): assertion '<dropped>' failed

It probably broke in 551d72280b. The code
above and below expects self->device may be NULL, so let's add a
NULL check here.
2021-12-15 16:33:00 +00:00
Georges Basile Stavracas Neto
234d1aadb7 common: Depend on generated sources
Generated sources need to be generated before files that
use them can be built.

Add a separate dependency on them, and make the various
libraries under panels/common/ depend on these sources.
2021-12-15 11:17:57 -03:00
Alexander Mikhaylenko
04e3497fa6 background-preview: Fix a measure() infloop 2021-12-14 22:34:21 -03:00
Georges Basile Stavracas Neto
efbad6eb50 network: Port to GTK4
Boy this was hard.

To ease the pain of porting wireless-security to GTK4, add
a new WsFileChooserButton class that mimics the behavior of
a button that triggers a filechooser, as per the migration
guide suggests.

There were lots of GtkGrids, so the diff is particularly
horrendous. Sorry.

This needs serious testing before landing.
2021-12-14 22:34:21 -03:00
Georges Basile Stavracas Neto
d189a67000 flatpak: Update dependencies to GTK4 2021-12-14 22:34:21 -03:00
Georges Basile Stavracas Neto
816e6203e3 wacom: Port to GTK4
Many part of this commit were made by Carlos
Garnacho <carlosg@gnome.org>

WIP wacom: Port to GTK4

Lots of stuff missing and probably broken.

wacom: Port CcDrawingArea input to gestures

We have a handy GtkGestureStylus to use here, which avoids direct
handling of GdkEvents.

wacom: Update current stylus tracking to GtkGestureStylus

Use the ::proximity signal to notice when we are being hovered with
a tablet stylus, and look up the tool from there.
2021-12-14 22:34:21 -03:00
Georges Basile Stavracas Neto
f598fb3ed6 display: Port to GTK4 2021-12-14 22:34:21 -03:00
Georges Basile Stavracas Neto
d00cc3929e [WIP] color: Port to GTK4
This is very rough still. The calibration code
is entirely untested.
2021-12-14 22:34:21 -03:00
Georges Basile Stavracas Neto
d9d670328b background: Port to GTK4
CcBackgroundPreview required some layout changes, but
overall a pretty easy port.
2021-12-14 22:34:21 -03:00
Georges Basile Stavracas Neto
ddf6ca9952 region: Port to GTK4
An uneventful port.
2021-12-14 22:34:21 -03:00
Georges Basile Stavracas Neto
c6dd59f378 datetime: Port to GTK4
Of particular relevance, the timezone map was massively cleaned up.
It is much more pleasant to use now.
2021-12-14 22:34:21 -03:00
Georges Basile Stavracas Neto
d7e794e7ab keyboard: Port to GTK4
Drop the wm-common insanity.
2021-12-14 22:34:21 -03:00
Georges Basile Stavracas Neto
8141af469c printers: Port to GTK4
Fortunately for us GtkTreeView still operates pretty
much exactly like in GTK3. Other than that, it's a
dense junction of all that we've done so far to port
other panels.
2021-12-14 22:34:21 -03:00
Georges Basile Stavracas Neto
2b11900b0c bluetooth: Port to GTK4
This needs libgnome-bluetooth-2.0, which was recently merged.
2021-12-14 22:34:21 -03:00
Georges Basile Stavracas Neto
b81a180c4f thunderbolt: Port to GTK4
The C code of this panel is just so. damn. good. Porting it was
a breeze.
2021-12-14 22:34:21 -03:00
Georges Basile Stavracas Neto
3b6b678db9 diagnostics: Port to GTK4
A trivial one.
2021-12-14 22:34:21 -03:00
Georges Basile Stavracas Neto
f043ca3680 sharing: Port to GTK4
Again, it was easier to just switch some of the code to use
AdwActionRow, and that's what I've done in this commit.
2021-12-14 22:34:21 -03:00
Georges Basile Stavracas Neto
25edfb4a4b mouse: Port to GTK4
This one is an interesting case. It was easier to simply switch
to AdwPreferencesPage than actually port all the GtkFrames in
there.

In addition to that, the mouse test page now uses a GtkPicture
instead of a GtkImage, and the GtkDrawingArea API changes are
reflected in the code.
2021-12-14 22:34:21 -03:00
Georges Basile Stavracas Neto
2d762680d2 usage: Port to GTK4 2021-12-14 22:34:21 -03:00
Georges Basile Stavracas Neto
696ed350bb applications: Port to GTK4 2021-12-14 22:34:21 -03:00
Georges Basile Stavracas Neto
6cfd6e0652 multitasking: Port to GTK4 2021-12-14 22:34:21 -03:00
Georges Basile Stavracas Neto
a0d49cb3a8 power: Port to GTK4
Extra care was needed for the combo boxes, and the way we currently
use GtkStringList is kind of hacky, but overall things seem to be
working fine.
2021-12-14 22:34:21 -03:00
Georges Basile Stavracas Neto
800cab08bf microphone: Port to GTK4 2021-12-14 22:34:21 -03:00
Georges Basile Stavracas Neto
b965f7cf50 lock: Port to GTK4
This one was even more trivial than the previous one!
2021-12-14 22:34:21 -03:00
Georges Basile Stavracas Neto
449c55be3a location: Port to GTK4
An almost trivial port too.
2021-12-14 22:34:21 -03:00
Georges Basile Stavracas Neto
26630338ba search: Port to GTK4
This one was the first panel ported that used Drag n' Drop, and
we can see how much of an improvement GTK4 is compared to GTK3
when handling DnD.
2021-12-14 22:34:21 -03:00
Georges Basile Stavracas Neto
c43eeea954 removable-media: Port to GTK4
A pretty boring, regular port again. No new challenges here.
2021-12-14 22:34:21 -03:00
Georges Basile Stavracas Neto
b9064cf2f6 default-apps: Port to GTK4
An easy one, mostly removing code from the UI file.
2021-12-14 22:34:21 -03:00
Georges Basile Stavracas Neto
9995a3bb79 universal-access: Port to GTK4
This was quite a huge port, but fortunately it mostly involved
removing tons of deprecated widgets (without replacement; just
drop them) and adjusting packing properties.
2021-12-14 22:34:21 -03:00
Georges Basile Stavracas Neto
a719008403 sound: Port to GTK4 2021-12-14 22:34:21 -03:00
Georges Basile Stavracas Neto
eff96c4cb1 camera: Port to GTK4 2021-12-14 22:34:21 -03:00
Georges Basile Stavracas Neto
75f6566a91 notifications: Port to GTK4
This one was relatively easy, since most of the brokenness came
from using deprecated properties that can just be dropped, and
packaging that can also just be dropped.
2021-12-14 22:34:21 -03:00
Georges Basile Stavracas Neto
3c8a0aa0b1 info-overview: Port to GTK4
- Remove visible=True properties from the UI file
 - Use GtkPicture for the OS logo
 - Drop gtk_dialog_run()
 - Port gnome-control-center-print-renderer to GTK4
   by using GdkSurface to create the GL context
2021-12-14 22:34:21 -03:00
Georges Basile Stavracas Neto
59bdf81028 common: Port to GTK4
This is only the bare minimum to make everything under panels/common
build. Since these widgets are used by the main window, port them
first.

CcTimeEntry was particularly hard to port. That's because GtkEntry
is a final class now. Overall, though, I'm happy with how it turned
out to be - much cleaner, less code, more obvious.
2021-12-14 22:34:21 -03:00
Georges Basile Stavracas Neto
5ca53a0a78 Drop Cheese dependency
Cheese is not ready for GTK4, and probably won't ever be, so just
drop the dependency. We'll reimplement webcam support using PipeWire
later.
2021-12-14 22:34:21 -03:00
Georges Basile Stavracas Neto
f41ab920b3 Disable all panels and tests
We'll start the transition by disabling all panels and tests, so that
we can go through them one by one, which should make the review process
significantly less painful.
2021-12-14 22:34:21 -03:00
Bastien Nocera
a9c398e5d9 color: Remove profile upload feature
As it was already removed in colord itself:
98f83acc91 (diff-cb19db05cc548372b27ebee7d47bc00b6788ad05da6f5d7fff107c45bbfba38f)

This removes the only direct libsoup 2.x dependency in
gnome-control-center.
2021-11-18 16:39:44 +01:00
Bastien Nocera
4b1f7011c4 wacom: Add scenario tester
Running the helper will launch gnome-control-center with a mocked Wacom
Cintiq tablet through umockdev when one isn't present or easily available.

The Cintiq was selected as it will trigger showing all the different
buttons Wacom tablets can make the panel spawn.
2021-11-18 14:57:22 +00:00
Bastien Nocera
8ac36f479e wacom: Add a fake stylus when mocking a tablet 2021-11-18 14:57:22 +00:00
Bastien Nocera
a93a023229 wacom: Split off notebook switching for detected stylus
This will reduce code duplication for mocking styli.
2021-11-18 14:57:22 +00:00
Bastien Nocera
d47b9be08a wacom: Print errors for libwacom_new_from_*() calls
This helps with debugging.
2021-11-18 14:57:22 +00:00