The current keyboard item API does not track whether the
keyboard shortcut is the default value or not. In order to
properly implement the Reset operation, the keyboard item
must receive this API and ideally handle it internally.
This patch adds the necessary API to CcKeyboardItem to track
whether the shortcut is the default value or not.
https://bugzilla.gnome.org/show_bug.cgi?id=769063
The collision detection code was removed in commit a0a155884e
as the cleanup was happening because the previous code was closely
tied to the user interface components.
Because that code wasn't appliable to the new listbox UI, it was
temporarily removed.
This patch re-adds this feature to work with the new code orgazination.
https://bugzilla.gnome.org/show_bug.cgi?id=769063
Instead of having CcKeyboardPanel managing both UI and backend code,
factor the backend code to a new CcKeyboardManager class and drop
backend management from the panel itself.
The new backend class handles the loading, creation and removal and
search of keyboard shortcuts. It also resolves reversible shortcuts
when searching.
This patch moves the code to this new class, and updates the rest of
the Keyboard panel to use it instead.
https://bugzilla.gnome.org/show_bug.cgi?id=769063
While using the Keyboard shortcut editor dialog under
Wayland, the user receives a <Meta> key even when this
key isn't present in the physical keyboard nor in the
keymap.
This is probably the result of Wayland inheriting from
X's xkb.
To work around that, simply filter out this modifier.
https://bugzilla.gnome.org/show_bug.cgi?id=769063
The current CcKeyboardPanel used to manage keyboard
editing through GtkCellRendererAccel, which was replaced
when we moved to use a GtkListBox. Because of that,
the ability to edit shortcuts is now missing.
Re-add shortcut editing capabilities through a new dialog,
which is done according to the latest mockups available.
https://bugzilla.gnome.org/show_bug.cgi?id=769063
After porting the shortcuts management entirely to
GtkListBox, the current treeview is not necessary
anymore.
This patch removes the shortcuts treeview and all
the related functions, and separates the treeviews
from the underlying models.
https://bugzilla.gnome.org/show_bug.cgi?id=769063
The accelerator formatting method itself is copied from
GtkCellRendererAccel, and will be used throughout the code
to format the accelerators just like they used to be before
moving to the listbox.
https://bugzilla.gnome.org/show_bug.cgi?id=769063
To allow a much easier porting to the new layout, the keyboard
panel is now a template class. That has various implications on
the code organization:
- The keyboard-shortcuts.c was responsible for filling the shortcuts.
Because it relied on the GtkBuilder of the panel, most of its code
was moved to the CcKeyboardPanel class.
- The unused code from the keyboard panel class had to be removed in
order to make it work again.
- All the hash tables and widgets are now part of the CcKeyboardPanel
structure.
- The interface elements have a single entry point.
https://bugzilla.gnome.org/show_bug.cgi?id=769063
gettext can extract strings from xml file formats with the help of
.its files. Provide appropriate rules so modules that install
keybinding descriptions don't need to depend on intltool to
extract translatable strings.
https://bugzilla.gnome.org/show_bug.cgi?id=769066
These classes are deprecated by Gtk+ and should be replaced
by vertical and/or horizontal GtkBoxes.
This commit replaces the usage of the deprecated box classes.
https://bugzilla.gnome.org/show_bug.cgi?id=769063
After introducing the autocleanup function to
CcPanel, it is now possible to remove a lot of
boilerplate code from the panels.
This commit ports CcKeyboardPanel to be a final
type, removing all the old boilerplate code in
the proccess.
https://bugzilla.gnome.org/show_bug.cgi?id=769063
Following the previous patch, this patch adds the new alternative
categories to the panels' Desktop files. These alternative categories
are only relevant for the alternative Shell, and do not break the
current Shell in any way.
https://bugzilla.gnome.org/show_bug.cgi?id=767301
Commit b3be076 added soft hyphens along with a comment for translators
to use those soft hyphens. Except that gettext would only grab the one
line out of the four we wrote for translators to read. Put them all on
the same line so that gettext actually extracts those.
https://bugzilla.gnome.org/show_bug.cgi?id=765778
Note that this fix will not automatically fix translations, which will
need to add soft-hyphens (U+00AD) to their translations themselves, and
will not fix larger fonts for which the split up syllables end up
being bigger than the maximum text width.
It's the best we can do without redesigning the Settings shell, which is
already something planned.
https://bugzilla.gnome.org/show_bug.cgi?id=647087#c13
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
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
==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
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
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
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
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
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
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=1094480https://bugzilla.gnome.org/show_bug.cgi?id=736117
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
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
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
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
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