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:
Generated
+1
-1
@@ -575,7 +575,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "moongreet"
|
name = "moongreet"
|
||||||
version = "0.7.1"
|
version = "0.7.4"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"gdk-pixbuf",
|
"gdk-pixbuf",
|
||||||
"gdk4",
|
"gdk4",
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "moongreet"
|
name = "moongreet"
|
||||||
version = "0.7.3"
|
version = "0.7.4"
|
||||||
edition = "2024"
|
edition = "2024"
|
||||||
description = "A greetd greeter for Wayland with GTK4 and Layer Shell"
|
description = "A greetd greeter for Wayland with GTK4 and Layer Shell"
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
|
|||||||
@@ -553,6 +553,18 @@ pub fn create_greeter_window(
|
|||||||
));
|
));
|
||||||
window.add_controller(key_controller);
|
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)
|
// Defer initial user selection until realized (for correct theme colors)
|
||||||
window.connect_realize(clone!(
|
window.connect_realize(clone!(
|
||||||
#[strong]
|
#[strong]
|
||||||
|
|||||||
Reference in New Issue
Block a user