This commit is contained in:
Junkui Zhang
2025-05-07 10:54:59 +08:00
parent e3bd1a0e41
commit e54780b2da

View File

@@ -85,8 +85,8 @@ impl PlatformKeyboardMapper for LinuxKeyboardMapper {
#[cfg(any(feature = "wayland", feature = "x11"))]
impl LinuxKeyboardMapper {
pub(crate) fn new() -> Self {
println!("{:?}", std::env::var("DISPLAY"));
let (xcb_connection, _) = XCBConnection::connect(None).unwrap();
let dpy_name = std::ffi::CString::new(":0").unwrap();
let (xcb_connection, _) = XCBConnection::connect(Some(&dpy_name)).unwrap();
let _ = xcb_connection
.xkb_use_extension(XKB_X11_MIN_MAJOR_XKB_VERSION, XKB_X11_MIN_MINOR_XKB_VERSION)
.unwrap()