fix: grab keyboard focus on map instead of realize (v0.7.4)
Update PKGBUILD version / update-pkgver (push) Successful in 3s
Update PKGBUILD version / update-pkgver (push) Successful in 3s
Layer-shell keyboard grab is only confirmed by the compositor at map time. The previous realize-time grab_focus() could fire before the compositor assigned keyboard input, causing intermittent input loss.
This commit is contained in:
@@ -553,6 +553,18 @@ pub fn create_greeter_window(
|
||||
));
|
||||
window.add_controller(key_controller);
|
||||
|
||||
// Grab keyboard focus after map — layer-shell keyboard grab is only
|
||||
// confirmed by the compositor at map time, not at realize time.
|
||||
window.connect_map(clone!(
|
||||
#[weak]
|
||||
password_entry,
|
||||
move |_| {
|
||||
glib::idle_add_local_once(move || {
|
||||
password_entry.grab_focus();
|
||||
});
|
||||
}
|
||||
));
|
||||
|
||||
// Defer initial user selection until realized (for correct theme colors)
|
||||
window.connect_realize(clone!(
|
||||
#[strong]
|
||||
|
||||
Reference in New Issue
Block a user