After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 709085 - keyboard: Don't set the XKB group switching option when not needed
keyboard: Don't set the XKB group switching option when not needed
Status: RESOLVED FIXED
Product: gnome-settings-daemon
Classification: Core
Component: keyboard
unspecified
Other All
: Normal normal
: ---
Assigned To: Rui Matos
gnome-settings-daemon-maint
Depends on:
Blocks:
 
 
Reported: 2013-09-30 11:47 UTC by Rui Matos
Modified: 2013-10-01 08:52 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
keyboard: Don't set the XKB group switching option when not needed (4.54 KB, patch)
2013-09-30 11:47 UTC, Rui Matos
committed Details | Review

Description Rui Matos 2013-09-30 11:47:03 UTC
Emmanuele got his keyboard layout in a confused state and reported it
on IRC the other day. This should fix it.
Comment 1 Rui Matos 2013-09-30 11:47:05 UTC
Created attachment 256076 [details] [review]
keyboard: Don't set the XKB group switching option when not needed

We might set up different layouts in different groups - see
replace_layout_and_variant(). But we don't want the X server group
switching feature to actually switch them. Regularly, if we have at
least two input sources, gnome-shell will tell us to switch input
source at that point so we fix that automatically. But when there's
only one source, gnome-shell short circuits as an optimization and
doesn't call us so we can't set the group switching XKB option in the
first place otherwise the X server's switch will take effect and we
get a broken configuration.
Comment 2 Bastien Nocera 2013-09-30 12:59:04 UTC
Review of attachment 256076 [details] [review]:

Looks good.
We should really have a couple of strv convenience functions in glib though.

::: plugins/keyboard/gsd-keyboard-manager.c
@@ +878,3 @@
+                        options[last] = NULL;
+                }
+                p += 1;

p++;?
Comment 3 Rui Matos 2013-10-01 08:52:28 UTC
(In reply to comment #2)
> ::: plugins/keyboard/gsd-keyboard-manager.c
> +                p += 1;
>
> p++;?

I tend to avoid the unary increment/decrement operators. I find them
harder to parse for some reason.

Pushed to master and 3.8.

Attachment 256076 [details] pushed as f3b6e35 - keyboard: Don't set the XKB group switching option when not needed