Commit graph

350 commits

Author SHA1 Message Date
Florian Müllner
eb3580ee9d media-keys: Handle 'Above_Tab' fake key
Mutter supports the 'Above_Tab' fake keysym that refers to the key
that is physically located above the tab key. It is used in the default
shortcut of the "Switch windows of an application" action.

As gtk_accelerator_parse() doesn't recognize the keysym, we display
the shortcut incorrectly as "disabled", and it is not taken into account
for conflict resolution.

Address this by translating binding that contains the 'Above_Tab' string
to bindings where the string is replaced with each possible keysym that
corresponds to the fixed keycode of KEY_GRAVE + 8.

https://gitlab.gnome.org/GNOME/gnome-control-center/issues/581
2019-09-10 13:32:08 +00:00
Robert Ancell
6fc8e57bdd keyboard: Make .ui filename match the .c filename 2019-09-09 21:58:01 +00:00
Robert Ancell
97985a664e Remove unused GNOMELOCALEDIR defines 2019-09-09 21:45:53 +00:00
Benjamin Berg
936a66f4ca keyboard: Add microphone mute key
Add the required UI for users to change the newly mic-mute keybinding.

See also https://bugzilla.gnome.org/show_bug.cgi?id=793596

https://bugzilla.gnome.org/show_bug.cgi?id=793641
2019-05-27 20:48:35 +00:00
Benjamin Berg
f972ffc569 keyboard: Clarify that mute key toggles the mute state
This is just a string change to make it clear that the mute keys toggle
the mute state rather than simply muting the volume.

https://bugzilla.gnome.org/show_bug.cgi?id=793641
2019-05-27 20:48:35 +00:00
Georges Basile Stavracas Neto
5ec241aae2 keyboard: Move "Reset All" to the start of the headerbar
https://gitlab.gnome.org/GNOME/gnome-control-center/issues/528
2019-05-21 13:00:32 -03:00
Georges Basile Stavracas Neto
75f150d5a2 shell: Add position to cc_shell_embed_widget_in_header()
So we can control where the widget should be added to. The
main window only supports left and right positions.

https://gitlab.gnome.org/GNOME/gnome-control-center/issues/528
2019-05-21 12:59:36 -03:00
Georges Basile Stavracas Neto
20b3d0c653 keyboard: Remove "Keyboard Shortcuts" section header
It's unnecessary now that we have "Keyboard Shortcuts" everywhere
else.
2019-05-21 12:09:00 -03:00
Georges Basile Stavracas Neto
9385cc78d1 keyboard: Rename panel to "Keyboard Shortcuts"
https://gitlab.gnome.org/GNOME/gnome-control-center/issues/528
2019-05-21 12:01:15 -03:00
Bastien Nocera
07485a1103 keyboard: Fix keyboard shortcut label
The instructions label says:
Press Esc to cancel or Backspace to reset the keyboard shortcut.
but the Backspace key set the shortcut to be empty, and disables the
feature. Reset is achieved clicking the button to the right handside of
the shortcut in the main window, and is only visible when the shortcut
isn't set to the default value.
2019-03-29 17:03:45 +00:00
Robert Ancell
465f096ea0 keyboard: Make .ui filename match the .c filename 2018-11-12 16:41:01 +00:00
Robert Ancell
13bfd725cd keyboard: Remove unused header file 2018-11-08 14:17:43 +13:00
Robert Ancell
bb4a9703e3 keyboard: Don't use gtk_widget_show_all
It is removed in GTK+ 4
2018-10-10 04:01:11 +00:00
Sam Hewitt
24174173be common: update pixel_size values to base 16 for icon clarity 2018-07-10 17:52:08 -04:00
Georges Basile Stavracas Neto
1b68bf1cb4 keyboard: Update code style
No functional changes were introduced. This is purely
aesthetical.
2018-05-29 13:50:17 -03:00
Robert Ancell
5174ae136d keyboard: Replace ifdefs with #pragma once 2018-05-29 15:44:19 +00:00
Robert Ancell
57975633e6 keyboard: Replace GObject boilerplace with G_DECLARE_TYPE 2018-05-29 15:44:19 +00:00
Robert Ancell
a90e13f12c keyboard: Use g_auto for variables 2018-05-29 10:35:14 +12:00
Andrea Azzarone
0d16cd3feb keyboard: Make "Set Shortcut" button accessible
Set 'can-focus' property to True for change_custom_shortcut_button, fixing
keyboard navigation in the shortcut editor dialog.

https://gitlab.gnome.org/GNOME/gnome-control-center/issues/45
2018-03-30 15:27:26 +00:00
Georges Basile Stavracas Neto
9a611e0d69 keyboard: Remove deprecated gdk_error_trap_push|pop calls
Instead, implement custom error push and pop functions that mimic
what GDK used to do, but using only non-deprecated functions.
2018-03-16 14:56:28 -03:00
Georges Basile Stavracas Neto
0269f6e5b2 keyboard: Trivial update to code style
This fixed many code style issues in wm-common, and add
a few g_autofree when possible.
2018-03-16 14:39:31 -03:00
Georges Basile Stavracas Neto
aba1647bea keyboard: Silence initialization warning
This field is always initialized properly before being
used, so let's not initialize it when declaring.
2018-03-16 14:19:43 -03:00
Georges Basile Stavracas Neto
ee66dc5f3f keyboard: Turn gchar** into GStrv and use g_auto 2018-03-16 14:18:45 -03:00
Georges Basile Stavracas Neto
4496b60c73 keyboard: Make unused public function static
It is not used outside wm-common.c, so let's not export
it as a public function.
2018-03-16 14:14:41 -03:00
Georges Basile Stavracas Neto
2416b4278d keyboard: Remove unused include 2018-03-16 14:14:11 -03: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
Bastien Nocera
a1f57ce50a keyboard: Simplify keyboard grab
https://bugzilla.gnome.org/show_bug.cgi?id=793070
2018-02-06 10:42:18 +01: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
Bastien Nocera
3dafd78569 keyboard: Simplify keyboard option object creation
https://bugzilla.gnome.org/show_bug.cgi?id=771009
2018-01-18 11:09:18 -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
Allan Day
8a8e53ab8a Standardize vertical spacing of panels
Ensure that the vertical spacing inside each panel is similar.
This makes the transition between each panel smoother and makes
the control center feel more cohesive.

Settings panels are given 32px above and below their content
and 32px vertical space between major sections. 12px space is
placed below headings.

Bluetooth, displays and printers are not addressed.

https://bugzilla.gnome.org/show_bug.cgi?id=786384
2017-08-20 18:38:42 +02:00
Florian Müllner
796981d390 keyboard: Special-case disabling of multi-bindings shortcuts
For shortcuts that support multiple bindings, the disabled state is
expressed as an empty list rather than a list with a single empty
element. While the latter certainly works as expected as far as the
actual keybinding is concerned, the shortcut will show up as modified
even if it is disabled by default. Explicitly setting bindings to the
empty list when a shortcut is disabled fixes this.

https://bugzilla.gnome.org/show_bug.cgi?id=784620
2017-07-24 21:43:24 -03:00
Florian Müllner
30c36d476e keyboard: Consider multiple bindings when resetting
While we are now able to find conflicts for a particular key combo in
non-primary bindings, in the case of resetting a shortcut we need to
check all key combos in case the shortcut itself has multiple bindings
by default.

https://bugzilla.gnome.org/show_bug.cgi?id=673078
2017-07-10 19:31:00 +02:00
Florian Müllner
dd024ae722 keyboard: Consider additional bindings in uniqueness checks
We now have everything in place to extend the uniqueness check to
consider all bindings of an item rather than just the first one.
With this it is finally possible to set Alt+Tab as binding for
"Switch windows" without keeping the hidden Alt+Tab binding of the
"Switch applications" shortcut ...

https://bugzilla.gnome.org/show_bug.cgi?id=673078
2017-07-10 19:31:00 +02:00
Florian Müllner
2e7c9531fa keyboard: Don't handle mask separately
Comparing masks is currently part of the early checks we perform to
determine that two bindings are different. There's some convenience
in that, however logically the mask is part of the binding, and
separating the mask check from comparing the "rest" of the binding
makes it harder to extend the comparison to consider multiple bindings.

https://bugzilla.gnome.org/show_bug.cgi?id=673078
2017-07-10 19:29:46 +02:00
Florian Müllner
ab353591f8 keyboard: Refactor finding of conflicting items
When comparing keys for uniqueness, we currently apply various tests to
check whether shortcuts are different, until we decide that we found a
conflict if none of the tests passed. That approach is a bit weird for
shortcuts that have a reverse item - when comparing a binding to two
different shortcuts, it should always be different from at least one of
them, so there should never be a conflict for any reversible shortcuts.
The reason it does work anyway is that reverse items usually only differ
in modifiers, which is_shortcut_different() currently doesn't consider at
all. We are about to change that however, so refactor the code to set the
conflicting item as soon as we find a match rather than as fall-through.

https://bugzilla.gnome.org/show_bug.cgi?id=673078
2017-07-10 19:29:43 +02:00
Florian Müllner
5e4fa7bd39 keyboard: Track all key combos
For shortcuts that support more than one binding, we currently simply
ignore all but the first. This makes some sense as we only expose a
single binding in the UI anyway, however it means that any extra
bindings are not taken into account for conflict resolution. In order
to address this in the future, start tracking all bindings of an item.

https://bugzilla.gnome.org/show_bug.cgi?id=673078
2017-07-10 19:29:43 +02:00
Florian Müllner
dccf794897 keyboard: Add dedicated key combo type
We currently store keyval, keycode and mask that make up a particular
key combo separately. However as we want to consider multiple bindings
for a single item, it makes more sense to combine them in a dedicated
struct type.

https://bugzilla.gnome.org/show_bug.cgi?id=673078
2017-07-10 19:29:43 +02:00
Florian Müllner
bd54cd1342 keyboard: Clear additional bindings when changing a shortcut
Some shortcuts allow multiple bindings for the same actions, which
we mainly use to keep supporting old settings when changing defaults.
Multiple bindings are not exposed in the interface though, so when
changing a shortcut with multiple bindings, we previously only updated
the first one and left additional bindings untouched. This is confusing
however, precisely because additional bindings are not shown in the
UI - for instance, this makes it impossible to actually disable
such a shortcut completely. The less confusing option is to clear
any additional bindings when changing a shortcut.

https://bugzilla.gnome.org/show_bug.cgi?id=673078
2017-07-10 19:29:43 +02:00
Florian Müllner
84d527645b keyboard: Don't create shortcuts editor twice
We are accidentally creating two editors, leaking the first instance ...

https://bugzilla.gnome.org/show_bug.cgi?id=784391
2017-07-05 09:22:21 -03:00
Florian Müllner
eed74317c4 keyboard: Fix another memory leak
The memory leak fixed in commit 870fb46201 is still present in
a copy-pasted version of the function, apply the same fix there
as well ...

https://bugzilla.gnome.org/show_bug.cgi?id=784356
2017-07-04 22:52:19 -03:00
Florian Müllner
3910b4ac9d keyboard: Follow the usual search pattern for filtering
Filtering on the name currently only matches the string as a whole,
not individual words as expected, for instance "home fo" and "ho fo"
should both match "Home Folder".

https://bugzilla.gnome.org/show_bug.cgi?id=784357
2017-06-29 21:36:30 -03:00
Florian Müllner
870fb46201 keyboard: Fix a memory leak
While the actual strings returned by g_variant_get_strv() are owned
by the variant, we still need to free the container ...

https://bugzilla.gnome.org/show_bug.cgi?id=784356
2017-06-29 21:22:51 -03:00
Georges Basile Stavracas Neto
7c405d77a7 keyboard: Inform that 'backspace' is the clear key
The Keyboard shortcut editor dialog gives no clue on how
to disable a shortcut, and users were confused by this
lack of information.

Fix that by informing the user about the Backspace role
when editing a shortcut.

https://bugzilla.gnome.org/show_bug.cgi?id=777401
2017-05-10 20:45:07 -03:00
Georges Basile Stavracas Neto
f981eb58ac keyboard: Add more key aliases
To improve even more the search feature, add the
following new key aliases:

Option  → Alt
Command → Super
Apple   → Super

https://bugzilla.gnome.org/show_bug.cgi?id=772565
2017-05-04 10:42:14 +02:00
Georges Basile Stavracas Neto
1cb787e8b8 keyboard: Also search shortcut accelerators
When managing the keyboard shortcuts, the user might want
to check for keybindings based on their accelerators, not
only their names. Currently, however, the Keyboard panel
only supports searching for the keybinding description.

Fix that by also considering the normalized keybinding
accelerator when performing the search.

https://bugzilla.gnome.org/show_bug.cgi?id=772565
2017-05-04 10:41:38 +02:00
Georges Basile Stavracas Neto
dce6fe6add keyboard: Move Remove button to the header bar
According to the mockups [1], the Remove button should
be placed at the start of the header bar. Currently,
however, it is positioned below the custom shortcut edit
button.

Fix that by moving the remove button to the header bar.

[1] https://raw.githubusercontent.com/gnome-design-team/gnome-mockups/master/system-settings/keyboard/keyboard-wires.png

https://bugzilla.gnome.org/show_bug.cgi?id=777846
2017-05-02 07:20:29 -03:00
Mohammed Sadiq
eeddf497af keyboard: Discard the added shortcut on Escape
If the user press Escape key after the user have set some shortcut,
don't save the newly set shortcut, and close the dialog.

https://bugzilla.gnome.org/show_bug.cgi?id=778748
2017-04-27 10:20:56 -03:00