protocols/keyboard-layout: Send ei modifiers on group change
This makes `cosmic-osk` show a group change on `super+space`. Previously a change like that wouldn't be sent until a keyboard input changed the modifier state, for instance releasing the shift key.
This commit is contained in:
parent
0d75928579
commit
8ec1ffb740
5 changed files with 19 additions and 11 deletions
|
|
@ -17,8 +17,10 @@ use smithay::{
|
|||
use std::mem;
|
||||
use wayland_backend::server::{ClientId, GlobalId};
|
||||
|
||||
pub trait KeyboardLayoutHandler {
|
||||
pub trait KeyboardLayoutHandler: SeatHandler {
|
||||
fn keyboard_layout_state(&mut self) -> &mut KeyboardLayoutState;
|
||||
/// Group has been changed through the protocol
|
||||
fn group_changed(&mut self, keyboard: &KeyboardHandle<Self>);
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
|
|
@ -57,6 +59,7 @@ impl KeyboardLayoutState {
|
|||
let active_layout = handle.with_xkb_state(state, |context| {
|
||||
context.xkb().lock().unwrap().active_layout()
|
||||
});
|
||||
state.group_changed(handle);
|
||||
if *last_layout != Some(active_layout) {
|
||||
keyboard_layout.group(active_layout.0);
|
||||
*last_layout = Some(active_layout);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue