Commit graph

531 commits

Author SHA1 Message Date
Bastien Nocera
1f192985ef keyboard: Remove general tab
The cursor blinking and repeat keys configuration options have moved to
the Universal Access panel, with the shortcuts panel due for a
re-design.

See https://bugzilla.gnome.org/show_bug.cgi?id=757486
See https://bugzilla.gnome.org/show_bug.cgi?id=757464

https://bugzilla.gnome.org/show_bug.cgi?id=757489
2015-11-04 13:20:01 +01:00
Christophe Fergeau
99ef490875 keyboard: Fix leak in settings_get_binding()
This fixes:
==5944== 64,392 bytes in 4,223 blocks are definitely lost in loss record 16,020 of 16,045
==5944==    at 0x4C28C50: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==5944==    by 0x1445EFCC: g_malloc (gmem.c:94)
==5944==    by 0x1445F2AE: g_malloc_n (gmem.c:330)
==5944==    by 0x144981DC: g_variant_get_strv (gvariant.c:1572)
==5944==    by 0x48FA45: settings_get_binding (cc-keyboard-item.c:369)
==5944==    by 0x48FA9D: binding_changed (cc-keyboard-item.c:384)
==5944==    by 0x141C3E2F: g_cclosure_marshal_VOID__STRINGv (gmarshal.c:1794)
==5944==    by 0x141BFBE3: _g_closure_invoke_va (gclosure.c:864)
==5944==    by 0x141DA3E7: g_signal_emit_valist (gsignal.c:3292)
==5944==    by 0x141DB55F: g_signal_emit (gsignal.c:3439)
==5944==    by 0x13EDC81D: g_settings_real_change_event (gsettings.c:386)

https://bugzilla.gnome.org/show_bug.cgi?id=756762
2015-10-19 11:19:17 +02:00
Christophe Fergeau
caacec3c86 keyboard: Fix leak when loading sections
This fixes:
==5944== 2,304 bytes in 5 blocks are definitely lost in loss record 15,724 of 16,045
==5944==    at 0x4C2AB9D: realloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==5944==    by 0x1445F0B8: g_realloc (gmem.c:159)
==5944==    by 0x144217CF: g_array_maybe_expand (garray.c:779)
==5944==    by 0x14420C9F: g_array_append_vals (garray.c:418)
==5944==    by 0x48ACFA: append_sections_from_file (keyboard-shortcuts.c:558)
==5944==    by 0x48B4EE: reload_sections (keyboard-shortcuts.c:737)
==5944==    by 0x48EA22: keyboard_shortcuts_init (keyboard-shortcuts.c:2109)
==5944==    by 0x489236: cc_keyboard_panel_constructor (cc-keyboard-panel.c:133)
==5944==    by 0x141C7C3F: g_object_new_with_custom_constructor (gobject.c:1697)
==5944==    by 0x141C7E71: g_object_new_internal (gobject.c:1777)
==5944==    by 0x141C8ADA: g_object_new_valist (gobject.c:2038)
==5944==    by 0x141C7A85: g_object_new (gobject.c:1622)
==5944==    by 0x4547DF: cc_panel_loader_load_by_name (cc-panel-loader.c:213)
==5944==    by 0x44DFCB: activate_panel (cc-window.c:157)
==5944==    by 0x4504D6: cc_window_set_active_panel_from_id (cc-window.c:1036)
==5944==    by 0x44E6A6: item_activated_cb (cc-window.c:280)

https://bugzilla.gnome.org/show_bug.cgi?id=756762
2015-10-19 11:19:17 +02:00
Christophe Fergeau
e235a8a062 keyboard: Fix leak in find_free_settings_path()
==5944== 90 (16 direct, 74 indirect) bytes in 1 blocks are definitely lost in loss record 11,855 of 16,045
==5944==    at 0x4C28C50: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==5944==    by 0x1445EFCC: g_malloc (gmem.c:94)
==5944==    by 0x1445F2AE: g_malloc_n (gmem.c:330)
==5944==    by 0x144982EC: g_variant_dup_strv (gvariant.c:1621)
==5944==    by 0x13EDF251: g_settings_get_strv (gsettings.c:2070)
==5944==    by 0x48D56E: find_free_settings_path (keyboard-shortcuts.c:1651)
==5944==    by 0x48D663: add_custom_shortcut (keyboard-shortcuts.c:1682)
==5944==    by 0x48DB04: add_button_clicked (keyboard-shortcuts.c:1788)

https://bugzilla.gnome.org/show_bug.cgi?id=756762
2015-10-19 11:19:17 +02:00
Christophe Fergeau
baff31f43e keyboard: Don't leak CcKeyboardItem::binding
It contains a strdup'ed string, but it's overwritten without being freed
first from cc_keyboard_item_load_from_gsettings_path() and
cc_keyboard_item_load_from_gsettings().

This fixes:
==5944== 976 bytes in 64 blocks are definitely lost in loss record 15,439 of 16,045
==5944==    at 0x4C28C50: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==5944==    by 0x1445EFCC: g_malloc (gmem.c:94)
==5944==    by 0x1445F2AE: g_malloc_n (gmem.c:330)
==5944==    by 0x144981DC: g_variant_get_strv (gvariant.c:1572)
==5944==    by 0x48FA45: settings_get_binding (cc-keyboard-item.c:369)
==5944==    by 0x48FDDD: cc_keyboard_item_load_from_gsettings (cc-keyboard-item.c:438)
==5944==    by 0x489EB7: append_section (keyboard-shortcuts.c:249)
==5944==    by 0x48ADF6: append_sections_from_file (keyboard-shortcuts.c:578)
==5944==    by 0x48B4EE: reload_sections (keyboard-shortcuts.c:737)
==5944==    by 0x48EA22: keyboard_shortcuts_init (keyboard-shortcuts.c:2109)
==5944==    by 0x489236: cc_keyboard_panel_constructor (cc-keyboard-panel.c:133)
==5944==    by 0x141C7C3F: g_object_new_with_custom_constructor (gobject.c:1697)
==5944==    by 0x141C7E71: g_object_new_internal (gobject.c:1777)
==5944==    by 0x141C8ADA: g_object_new_valist (gobject.c:2038)
==5944==    by 0x141C7A85: g_object_new (gobject.c:1622)
==5944==    by 0x4547DF: cc_panel_loader_load_by_name (cc-panel-loader.c:213)
==5944==    by 0x44DFCB: activate_panel (cc-window.c:157)
==5944==    by 0x4504D6: cc_window_set_active_panel_from_id (cc-window.c:1036)

https://bugzilla.gnome.org/show_bug.cgi?id=756762
2015-10-19 11:19:17 +02:00
Christophe Fergeau
c84722248e shell: Revert "Let panels have their own commandline flags"
This reverts commit 31a8a99440.

This was meant for bgo#695885 which has stalled for a while, so this
feature has no in-tree user. This commit removes it for now, this can be
readded when users for it materialize.

https://bugzilla.gnome.org/show_bug.cgi?id=751597
2015-07-16 11:49:34 +02:00
Bastien Nocera
71de309ff2 keyboard: Fix gtk_tree_model_get_iter_first() retval
https://bugzilla.gnome.org/show_bug.cgi?id=749892
2015-05-27 11:06:02 +02:00
Christophe Fergeau
5f7ee29a44 keyboard: Honor immutable command/name in custom commands
If the gsettings key for the command or name of a custom shortcut is not
writable, the keyboard panel still lets you edit them. This commits
makes the corresponding widgets unsensitive when the gsettings key is
not writable.

https://bugzilla.gnome.org/show_bug.cgi?id=749381
2015-05-15 19:44:00 +02:00
Christophe Fergeau
4257d8723d keyboard: Remove unused CcKeyboardItem::group
The BindingGroupType is stored in the section tree model instead.

https://bugzilla.gnome.org/show_bug.cgi?id=749381
2015-05-15 19:44:00 +02:00
Christophe Fergeau
b442126db1 keyboard: Remove 'gettext_package' handling
It's part of CcKeyboardItem but nothing uses it. It's also parsed
when loading KeyListEntry XML, but never used. The key description is
translated using Keylist::package before gettext_package is assigned.

https://bugzilla.gnome.org/show_bug.cgi?id=749381
2015-05-15 19:44:00 +02:00
Christophe Fergeau
241b4034ce keyboard: Remove unused cc_keyboard_item_get_binding
https://bugzilla.gnome.org/show_bug.cgi?id=749381
2015-05-15 19:44:00 +02:00
Christophe Fergeau
b7a2d17548 keyboard: Make CcKeyboardItem::binding private
It's not used outside of CcKeyboardItem

https://bugzilla.gnome.org/show_bug.cgi?id=749381
2015-05-15 19:44:00 +02:00
Rui Matos
8ea40157b6 keyboard: Add proper casts to silence compiler warnings 2015-02-17 14:55:43 +01:00
Marcus Karlsson
fe9fe99439 keyboard: custom shortcut should require name and command
It is possible to press the Add button in the custom shortcut dialog
when the name and command fields are empty. Disable the button by
default, and only enable it when the name and command is non-empty.

https://bugzilla.gnome.org/show_bug.cgi?id=739647
2015-02-10 13:50:17 +01:00
Rui Matos
2a36a4c607 keyboard: Switch to new peripherals settings schema
Most peripherals settings have been moved to
gsettings-desktop-schemas.

https://bugzilla.gnome.org/show_bug.cgi?id=743194
2015-01-20 14:09:09 +01:00
Lapo Calamandrei
caf76dc4c5 keyboard: remove superfluous frame
See https://bugzilla.gnome.org/show_bug.cgi?id=739818
2014-11-10 20:04:54 +01:00
Frédéric Péters
b36685f9a8 keyboard: allow shortcut explanation text to wrap
https://bugzilla.gnome.org/show_bug.cgi?id=736966
2014-09-22 22:09:53 +02:00
Bastien Nocera
72cd2e69e1 keyboard: Add translator comments to new feature
Conflict resolution and automatic "Shift" assignment need some
examples for translators to do their work.

https://bugzilla.gnome.org/show_bug.cgi?id=736336
2014-09-09 17:07:07 +02:00
Bastien Nocera
439eb22ca1 keyboard: Fix a crash if the WM changes (or restarts)
By stopping watching for WM changes when leaving the shortcuts panel.

 #0 reload_sections
 #1 wm_window_event_filter
 #2 gdk_event_apply_filters at gdkeventsource.c:81
 #3 gdk_event_source_translate_event at gdkeventsource.c:195
 #4 _gdk_x11_display_queue_events at gdkeventsource.c:338
 #5 gdk_display_get_event at gdkdisplay.c:313
 #10 g_main_context_iteration at gmain.c:3766
 #11 g_application_run at gapplication.c:1623

See https://bugzilla.redhat.com/show_bug.cgi?id=1094480

https://bugzilla.gnome.org/show_bug.cgi?id=736117
2014-09-05 14:15:59 +02:00
Bastien Nocera
6c43ebe3b0 keyboard: Make it possible to stop watching for WM changes
As we don't want to be doing that anymore if we're not in the keyboard
panel anymore.

https://bugzilla.gnome.org/show_bug.cgi?id=736117
2014-09-05 14:15:59 +02:00
Bastien Nocera
110bc2ebb5 keyboard: Fix warnings when clearing the help shortcut
(gnome-control-center:20334): GLib-CRITICAL **: g_variant_new_string: assertion 'string != NULL' failed

 #0  g_logv (log_domain=0x7fffec6a040e "GLib", log_level=G_LOG_LEVEL_CRITICAL, format=<optimized out>, args=args@entry=0x7fffffffd148) at gmessages.c:1046
 #1  0x00007fffec63ca12 in g_log (log_domain=log_domain@entry=0x7fffec6a040e "GLib", log_level=log_level@entry=G_LOG_LEVEL_CRITICAL, format=format@entry=0x7fffec6a9cbd "%s: assertion '%s' failed") at gmessages.c:1079
 #2  0x00007fffec63ca39 in g_return_if_fail_warning (log_domain=log_domain@entry=0x7fffec6a040e "GLib", pretty_function=pretty_function@entry=0x7fffec6fa860 <__FUNCTION__.5201> "g_variant_new_string", expression=expression@entry=0x7fffec6fc5f2 "string != NULL") at gmessages.c:1088
 #3  0x00007fffec66890a in g_variant_new_string (string=string@entry=0x0) at gvariant.c:1227
 #4  0x00007fffecc34dd4 in g_settings_set_string (settings=settings@entry=0x14b3640, key=key@entry=0x14caac0 "help", value=value@entry=0x0) at gsettings.c:1708
 #5  0x000000000047cd2e in settings_set_binding (value=0x0, key=0x14caac0 "help", settings=0x14b3640) at cc-keyboard-item.c:117
 #6  _set_binding (set_backend=1, value=<optimized out>, item=<optimized out>) at cc-keyboard-item.c:155
 #7  cc_keyboard_item_set_property (object=<optimized out>, prop_id=<optimized out>, value=<optimized out>, pspec=0x146e300) at cc-keyboard-item.c:204
 #8  0x00007fffec93b3eb in object_set_property (nqueue=<optimized out>, value=<optimized out>, pspec=<optimized out>, object=<optimized out>) at gobject.c:1415
 #9  g_object_set_valist (object=0x149fc00, first_property_name=0x146e300 "\320\064\231", var_args=0x7fffffffd378) at gobject.c:2159
 #10 0x00007fffec93bc0f in g_object_set (_object=0x149fc00, first_property_name=first_property_name@entry=0x53a4a6 "binding") at gobject.c:2269
 #11 0x0000000000479652 in accel_cleared_callback (cell=<optimized out>, path_string=<optimized out>, data=<optimized out>) at keyboard-shortcuts.c:1625
2014-09-05 10:05:58 +02:00
Christophe Fergeau
2dbcb26f16 keyboard: Use NULL rather than "" to disable keybindings
When disabling a keybinding, we set its value to { "", NULL } in gsettings
(bindings are stored as arrays of strings).
However, when a binding is disabled by default, its value is set to {
NULL }, not to the empty string.

The use of "" dates back to gconf where I think NULL was not a valid
value. Now that we have switched to gsettings, we can use NULL rather
than an artificial "".

https://bugzilla.gnome.org/show_bug.cgi?id=732383
2014-08-17 20:16:27 +02:00
Christophe Fergeau
ba9a8bc8ff keyboard: Add support for hidden keybinding XML data
If a KeyListEntry has a hidden="true" attribute, then the corresponding
binding information will be loaded as usual, but the binding won't be
displayed in the user interface.

This is useful as the keyboard panel will take into account hidden
keybindings when detecting conflicting shortcuts, or to suggest to set a
reverse shortcut.

For now, this will be used for the various reverse mutter keybindings
({switch,cycle}.*-backward) as they should not be shown in the UI, but
we still want the keyboard panel to know about them.

https://bugzilla.gnome.org/show_bug.cgi?id=731618
2014-08-17 20:16:27 +02:00
Christophe Fergeau
c77d164aa9 keyboard: Add 'reverse' metadata to switch-input-source shortcuts
Now that the keyboard panel knows how to handle reverse shortcuts, we
can start annotating the existing ones with the needed XML attributes.
This commit does that with switch-input-source{-backward}.
Note that some changes in some modules are needed for this to work
correctly.
In this case, a default value needs to be set for
switch-input-source-backward in gsettings-desktop-schemas, and the
Meta.KeyBindingFlags.REVERSED flag needs to be removed from the
shortcuts defined in gnome-shell source. Instead of having
mutter handle the reversion with 'shift' by itself, it's now handled
explicitly through gsettings keys.

https://bugzilla.gnome.org/show_bug.cgi?id=731618
2014-08-17 20:16:26 +02:00
Christophe Fergeau
5147cf2502 keyboard: Suggest to automatically set reverse bindings
Since we now know when a binding has a 'reverse' binding, we can now
suggest to update the 'reverse' shortcut when the user set a shortcut
for one of them.

https://bugzilla.gnome.org/show_bug.cgi?id=731618
2014-08-17 20:16:26 +02:00
Christophe Fergeau
f7c095bfe2 keyboard: Parse 'reverse' and 'is-reversed'
This commit adds support for 'reverse' and 'is-reversed' attributes when
parsing the KeyListEntry XML node.

https://bugzilla.gnome.org/show_bug.cgi?id=731618
2014-08-17 20:16:26 +02:00
Christophe Fergeau
f059f42487 keyboard: Add 'reverse' helpers to CcKeyboardItem
In order to handle shortcuts which can be reversed (for example,
super-space and shift-super-space to switch input methods
forward/backward), we are going to add new attributes to the xml files
describing the keyboard shortcuts to show in the panel.

This commit is a first step towards that and adds the notion of
'reverse' items to CcKeyboardItem.

We will then indicate in the xml description files that
'switch-input-source' is reversed by 'switch-input-source-backward' and
that 'switch-input-source-backward' reverses 'switch-input-source'.

https://bugzilla.gnome.org/show_bug.cgi?id=731618
2014-08-17 20:16:26 +02:00
Christophe Fergeau
10fd199b02 keyboard: Split accel_edit_callback
This function is getting a bit big, and the next commits will add more
code to it.

https://bugzilla.gnome.org/show_bug.cgi?id=731618
2014-08-17 20:16:26 +02:00
Kalev Lember
c5c870a558 keyboard: Port shortcuts tab to GtkGrid
https://bugzilla.gnome.org/show_bug.cgi?id=709057
2014-08-15 14:45:31 +02:00
Kalev Lember
c3d2631a9a keyboard: Port typing tab to GtkGrid
https://bugzilla.gnome.org/show_bug.cgi?id=709057
2014-08-15 14:45:31 +02:00
Kalev Lember
34d145b40d keyboard: Port custom shortcut dialog to GtkGrid
https://bugzilla.gnome.org/show_bug.cgi?id=709057
2014-08-15 14:45:31 +02:00
Rui Matos
509bf4b5d0 keyboard: Add "print screen" and "scroll lock" to compose key options
These are reasonable enough that we don't have to hide them.

https://bugzilla.gnome.org/show_bug.cgi?id=733400
2014-07-21 11:22:26 +02:00
Christophe Fergeau
74a09b932c keyboard: Use AM_CPPFLAGS rather than INCLUDES
This is deprecated in newer automake versions, and this causes warnings
with automake 1.14:
panels/printers/Makefile.am:3: warning: 'INCLUDES' is the old name for
AM_CPPFLAGS' (or '*_CPPFLAGS')

https://bugzilla.gnome.org/show_bug.cgi?id=732189
2014-06-25 12:28:18 +02:00
Christophe Fergeau
bb706f7b75 Add shortcut to launch gnome-control-center
https://bugzilla.gnome.org/show_bug.cgi?id=729052
2014-06-13 15:09:03 +02:00
Yosef Or Boczko
3758203a12 keyboard: Use header bar in the custom shortcut dialog
https://bugzilla.gnome.org/show_bug.cgi?id=724299
2014-04-28 17:29:18 +03:00
Matthias Clasen
cd498a06b3 keyboard: drop hard X dependency
The code to listen for window manager changes only makes sense under
X, so don't use it under Wayland. In that case, we can just assume
that we are under GNOME shell when we find a wayland display.

https://bugzilla.gnome.org/show_bug.cgi?id=728679
2014-04-22 17:28:04 -04:00
Rui Matos
e08e744578 keyboard: Whitelist a few more options for the 3rd level chooser
These work as good as the others since they're simple switches and it
seems that some users want them.

https://bugzilla.gnome.org/show_bug.cgi?id=724066
2014-02-11 10:56:56 +01:00
Daniel Mustieles
2c5951819d Updated FSF's address 2014-01-29 11:27:38 +01:00
Yosef Or Boczko
29881b48a8 keyboard: Use margin-start/end instead of margin-left/right
https://bugzilla.gnome.org/show_bug.cgi?id=712661
2013-11-19 22:30:28 +02:00
Jasper St. Pierre
dd52ac9417 Add NoDisplay to all gnome-control-center panel .desktop files
These aren't apps -- they're simply launchers for gnome-control-center.
They should not be shown as apps in the UI at all.

https://bugzilla.gnome.org/show_bug.cgi?id=712246
2013-11-15 08:44:53 -05:00
Rui Matos
f444c7b28c keyboard: Don't leak a dialog
https://bugzilla.gnome.org/show_bug.cgi?id=708286
2013-10-01 10:05:02 +02:00
Rui Matos
640cdb4c47 keyboard: Remove unused toplevel window from .ui file
https://bugzilla.gnome.org/show_bug.cgi?id=708286
2013-10-01 10:05:02 +02:00
Jasper St. Pierre
6615c7de89 keyboard: Add a screencast shortcut entry 2013-08-14 21:00:41 -04:00
Rui Matos
5b98213b04 keyboard: Add the XKB option for the input source switch shortcut
Mutter now uses the "grp" XKB option to implement a special
modifiers-only shortcut use by gnome-shell to switch input sources.

https://bugzilla.gnome.org/show_bug.cgi?id=700346
2013-05-27 10:23:28 +02:00
Rui Matos
1f03f33230 Remove the input-source-switcher setting
Mutter now has a special modifiers-only shortcut used by gnome-shell
to switch input sources which no longer uses this setting.

This reverts commit ae3014ba3e.
This reverts commit 77b7569c3d.

https://bugzilla.gnome.org/show_bug.cgi?id=700346
2013-05-27 10:23:26 +02:00
Matthias Clasen
5c4872d77c Add translator comments to some strings
Explain what Alternative Character Key and Compose Key are,
to increase the chances of meaningful translation.
https://bugzilla.gnome.org/show_bug.cgi?id=697213
2013-05-18 18:06:00 -04:00
Rui Matos
0b7479572e Revert "Revert "Use a common definition for modifier-only keybindings array""
This reverts commit 34906dba27.
2013-05-13 16:26:01 +02:00
Rui Matos
6a523d096b Revert "Revert "Add the input-source-switcher to the shortcuts""
This reverts commit 971e6a81ae.
2013-05-13 16:25:54 +02:00
Rui Matos
7d5eed0404 Revert "wip"
This reverts commit 0a14e8216a.
2013-05-13 16:25:45 +02:00
Rui Matos
0a14e8216a wip 2013-05-13 16:22:00 +02:00