Skip to content

Commit

Permalink
Use user's xkb options (#658)
Browse files Browse the repository at this point in the history
  • Loading branch information
lenemter committed Jun 26, 2023
1 parent e8c00ad commit 6288e7c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
1 change: 1 addition & 0 deletions data/greeter.metainfo.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
</description>
<issues>
<issue url="https://github.com/elementary/greeter/issues/25">Mask corners</issue>
<issue url="https://github.com/elementary/greeter/issues/541">Some shortcuts to switch keyboard layout does not work on lockscreen</issue>
</issues>
</release>

Expand Down
10 changes: 8 additions & 2 deletions src/Cards/UserCard.vala
Original file line number Diff line number Diff line change
Expand Up @@ -437,10 +437,16 @@ public class Greeter.UserCard : Greeter.BaseCard {
elements += result;
}

GLib.Variant list = new GLib.Variant.array (new VariantType ("(ss)"), elements);
settings.set_value ("sources", list);
GLib.Variant layouts_list = new GLib.Variant.array (new VariantType ("(ss)"), elements);
settings.set_value ("sources", layouts_list);

settings.set_value ("current", settings_act.active_keyboard_layout);

string[] options = {};
foreach (var option in settings_act.xkb_options) {
options += option.option;
}
settings.set_value ("xkb-options", options);
}

private void set_mouse_touchpad_settings () {
Expand Down
5 changes: 5 additions & 0 deletions src/PantheonAccountsServicePlugin.vala
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,13 @@ interface Pantheon.SettingsDaemon.AccountsService : Object {
public string name;
}

public struct XkbOption {
public string option;
}

public abstract KeyboardLayout[] keyboard_layouts { owned get; set; }
public abstract uint active_keyboard_layout { get; set; }
public abstract XkbOption[] xkb_options { owned get; set; }

public abstract bool left_handed { get; set; }
public abstract int accel_profile { get; set; }
Expand Down

0 comments on commit 6288e7c

Please sign in to comment.