Commit 4fdce280 authored by Dorota Czaplejewicz's avatar Dorota Czaplejewicz
Browse files

layouts: Stop assuming that layout name always changes on switch

Layout type switching outside of overlay was always done with gsettings in the middle, assuming that all clicks on languages in the popover result in a gsettings event. That's a bad assumption if there's only one xkb lang present.

This is a simple work around. A better solution would be to turn the entire system of layout switching into a central object that receives messages about changes that need to be applied, and then applies them.
parent acac00bc
...@@ -213,7 +213,16 @@ fn set_visible_layout( ...@@ -213,7 +213,16 @@ fn set_visible_layout(
layout_id: LayoutId, layout_id: LayoutId,
) { ) {
match layout_id { match layout_id {
LayoutId::System { kind, name } => set_layout(kind, name), LayoutId::System { kind, name } => {
unsafe {
use std::ptr;
set_layout(kind, name);
LayoutId::Local(name) => { LayoutId::Local(name) => {
let name = CString::new(name.as_str()).unwrap(); let name = CString::new(name.as_str()).unwrap();
let name_ptr = name.as_ptr(); let name_ptr = name.as_ptr();
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment