Commit graph

429 commits

Author SHA1 Message Date
Mohammed Sadiq
9318791d01 keyboard: Use CcListRow where appropriate 2022-11-25 20:18:36 +05:30
Jake Dane
89443fe550 desktop: Remove obsolete Bugzilla entries
The `X-GNOME-Bugzilla-*` entries were for use by bug-buddy, a GNOME 2
technology that's been gone for over a decade. These entries are
obsolete and can be removed from all desktop files.

The `X-GNOME-Settings-Panel` entry is also obsolete as far as I can
tell and only these panels had it in their desktop file: notifications,
sharing, sound and user-accounts. These entries can also be removed.

After removing the `X-GNOME-Bugzilla-*` entries, the desktop files have
no more variables in them. The meson `configure_file` step is therefor
pointless—there are no variables to configure. As such the
`*.desktop.in.in` files are renamed to `*.desktop.in` to reflect this
and `meson.build` files are modified to remove `configure_file` step.
2022-10-20 13:20:09 +00:00
Sebastian Keller
7f6dc4511f tests: Add test for keyboard shortcut normalization
This tests if the shortcuts generated from an event are in the format
that the shell expects.
2022-08-22 12:49:13 +00:00
Sebastian Keller
bad61a2229 keyboard: Handle shift shortcut modifier the same way as the shell does
The way shortcuts in mutter/gnome-shell work is that it looks up the
keycode that generates the shortcut keyval at the lowest shift level and
then checks if all the modifiers match. This does not work for shortcuts
that for example include "dollar" to represent "<Shift>4", because on
some keyboards/layout there is a separate dollar key key with its own
keycode. This would be at a lower shift level than "<Shift>4".

By always translating such shortcuts to "<Shift>number", we make sure
the resulting shortcut will work in the shell and is closer to what the
user likely intended the shortcut to be, because numbers are usually
assigned to things that can be enumerated, such as workspaces or
favorite applications.

This also special cases the num-row key on layouts such as AZERTY, where
the number is the shifted keyval, to always prefer the number. Due to
the way the shell interprets these shortcuts, they still work and by
always using numbers they work across different layouts.

This change also fixes that pressing "<Shift><Super>4" was turned into
"<Shift><Super>dollar", which effectively included the "<Shift>" twice.

Fixes: https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1528
2022-08-22 12:49:13 +00:00
Sebastian Keller
986a37ff6c keyboard: Split out function to normalize keyval and modifier mask
This will allow it to be tested in a unit test in an upcoming commit.
2022-08-22 12:49:13 +00:00
Pablo Correa Gómez
18eea16ff3 keyboard: fix permission_acquired always returning FALSE 2022-08-20 20:47:35 +00:00
Mohammed Sadiq
5f3b16b288 keyboard: Fix activation of input source toggle button
When the options are changed, the first item was never shown as
active when selected.  Fix it by binding to the inverse of the
button state instead of binding both toggle buttons to settings.

Fixes #1653
2022-08-15 08:26:16 +00:00
Georges Basile Stavracas Neto
261545b6cb keyboard: Set mnemonics to header buttons
Fixes https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1863
2022-05-25 16:41:28 +00:00
Robert Ancell
64768de705 keyboard: Fix typo in a11y label 2022-05-16 10:05:29 +12:00
Ian Douglas Scott
fbadba1a18 keyboard: Avoid segfault due to no "data" for custom_shortcut_add_row
Ultimately it would be good to get rid of the use of
`g_object_set_data`/`g_object_get_data` here, but this works for now.

Fixes https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1373.
2022-05-10 04:11:57 +00:00
Lukáš Tyrychtr
31d6c7704c Add some missing a11y labels in the keyboard panel 2022-05-10 04:00:40 +00:00
Alberts Muktupāvels
ea47caa533
keyboard: restore _GNOME_WM_KEYBINDINGS support
Before d7e794e7ab Keyboard Shortcuts dialog showed keybindings
for current WM. This commit restores this functionality.
2022-03-07 17:46:37 +02:00
Christopher Davis
9a2cd1b5d2 keyboard: Don't dim input chooser icons
We generally don't dim icons in rows anymore.
2022-02-13 13:33:25 +00:00
Christopher Davis
4ccf6e670b keyboard: Adjust input chooser widgetry
Adjusts the widgetry of the input chooser to clamp
the list and add a separator between the search bar
and the list.

The list's shadow is no longer clipped, and keyboard
navigation now scrolls.
2022-02-13 13:33:25 +00:00
Christopher Davis
cd4dd18f52 keyboard: Handle keynav-failed on input source list
Fixes keynav with arrows between the input list
group and other groups.
2022-02-13 13:33:25 +00:00
Christopher Davis
1a3971fdbe keyboard: Allow input list rows to manage their own size
Using GtkSizeGroup causes weird jumping,
and size groups generally should not be used for
boxed list rows.
2022-02-13 13:33:25 +00:00
Christopher Davis
ced8c1cb99 keyboard: Use GAction and GMenuModel for input row popovers
Gives these menus proper styling without having to
roll our own widgets.

Also removes the Remove button when the action is
disabled.
2022-02-13 13:33:25 +00:00
Christopher Davis
530fbac68e keyboard: Subclass AdwActionRow for InputRow 2022-02-13 13:33:25 +00:00
Christopher Davis
485dd456bb keyboard: Use AdwActionRow for input switch rows 2022-02-13 13:33:25 +00:00
Christopher Davis
84becfbd80 keyboard: Use AdwPreferences{Page,Group} 2022-02-13 13:33:25 +00:00
Ivan Molodetskikh
3ecc151061 keyboard: Remove 01-screenshot.xml
Move this to gnome-shell where it belongs. See
https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2107
2022-02-12 12:18:29 +00:00
Jakub Steiner
13376ecb8b Add individual app icons 2022-01-31 14:08:22 +00:00
Ivan Molodetskikh
03299794a6 keyboard: Update screenshot key bindings
They moved from g-s-d to gnome-shell.
2022-01-27 23:00:05 +00:00
Georges Basile Stavracas Neto
0ab20af9ba panels: Switch to CcPanel content
Start porting panels to the new panel format. This commit
temporarily makes panels have two titlebar, which will be
fixed soon.
2022-01-20 02:23:42 +00:00
Jan Beich
37b29c32cb meson: drop unused argument for i18n.merge_file()
Ignored in Meson < 0.60.0, deprecated since 0.60.1 and fatal since 0.61.0.

panels/applications/meson.build:10:5: ERROR: Function does not take positional arguments.
panels/background/meson.build:10:5: ERROR: Function does not take positional arguments.
panels/camera/meson.build:10:5: ERROR: Function does not take positional arguments.
[...]
2022-01-07 17:22:43 +00:00
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
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
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
Georges Basile Stavracas Neto
d7e794e7ab keyboard: Port to GTK4
Drop the wm-common insanity.
2021-12-14 22:34:21 -03:00
Andre Klapper
54a360811c Update keyboard related panel descriptions
Input Sources moved from Region & Language to Keyboard section in 40

Fixes #1447
2021-09-07 07:48:15 +00:00
Nishal Kulkarni
7bd8a4e50c keyboard: deprecation fix
Change `g_binding_get_source` to `g_binding_dup_source` in keyboard
2021-08-15 11:29:19 +00:00
Mohammed Sadiq
1fa95b5fc5 keyboard: Use content style for listboxes 2021-05-19 03:25:47 +00:00
Ian Douglas Scott
edffd1b295 keyboard: Create CcXkbModifierDialog only when used
This should avoid issues where this setting is changed just by opening
Gnome Control Center, as reported in
https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/918

This should also mean someone can tweak the settings as desired outside
Gnome Control Center, and not have them clobbered unless they open the
dialog in g-c-c.
2021-05-19 03:20:41 +00:00
Ian Douglas Scott
e224e5177a keyboard: Rename XkbOption and XkbModifier with Cc prefix 2021-05-19 03:20:41 +00:00
Ian Douglas Scott
3a50deb431 keyboard: Update panel layout with descriptions for sections
Changes based on mockup by @aday:
https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1222#note_1017128
2021-05-07 03:08:11 +00:00
Claude Paroz
d0d44dd6cd keyboard: Use g_dngettext to allow pluralized 'modified' string 2021-04-13 01:31:13 +00:00
Rachit Keerti Das
fccfb52cad keyboard: Improve Empty Search State.
The empty search state looks out-of place due to it being nested inside
a listbox. This is because we can only detect empty states through
gtk_list_filter_func().

Refine it by making the empty search placeholder a child of the main stack.
Introduce an additional helper function to detect when all the listbox
rows would be hidden by the filter.

As a part of https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1222
2021-02-12 15:41:10 +13:00
Ian Douglas Scott
252f8659c8 keyboard: Use g_type_ensure() 2021-01-11 15:19:36 -08:00
Ian Douglas Scott
621dd80ab0 keyboard: Do now call g_binding_unbind() finalizing shortcut editor
This errors and is unnecessary because the binding is removed when the
object bound is finalized.
2021-01-11 15:19:36 -08:00
Ian Douglas Scott
3fdb5f7ab2 keyboard: Correctly free references when finalizing shortcut dialog 2021-01-11 15:19:33 -08:00
Ian Douglas Scott
5e8e9c3236 keyboard: Right align shortcut
Reset button is in a `GtkRevealer` to not take up space when hidden.
2020-12-18 08:11:24 -08:00
Ian Douglas Scott
fd661a6607 keyboard: Use "+" row at end of custom shortcuts, not another box 2020-12-18 07:55:41 -08:00
Ian Douglas Scott
959d530c44 keyboard: Use HdyActionRow for shortcut/category 2020-12-18 07:55:41 -08:00
Ian Douglas Scott
a7d526f70b keyboard: Display shortcut for switching input source 2020-12-18 07:55:41 -08:00
Ian Douglas Scott
a19c7c2e65 keyboard: Change wording for switch input source 2020-12-18 07:55:41 -08:00
Ian Douglas Scott
e39a2916f3 keyboard: change margins of CcInputRow to better fit keyboard panel 2020-12-18 07:55:41 -08:00
Ian Douglas Scott
f1e8f9b364 keyboard: Add margins between sections, like other panels 2020-12-18 07:55:41 -08:00
Ian Douglas Scott
a89b83c9ec keyboard: Use HdyClamp to expand similarly to other panels 2020-12-18 07:55:41 -08:00