Revert select_xkb_events to its previous impl
The new implementation of select_xkb_events apparently misconfigures the server. This commit does a temporary fix by just reverting it to its previous implementation. This is temporary until I can figure out what Xlib is doing behind the scenes or until I read xkbproto.pdf. Fixes: #3079 Signed-off-by: John Nunley <dev@notgull.net>
This commit is contained in:
parent
e648169861
commit
4f0ce7201d
1 changed files with 10 additions and 26 deletions
|
|
@ -1,8 +1,7 @@
|
||||||
use std::{slice, str};
|
use std::{slice, str};
|
||||||
use x11rb::errors::{ConnectionError, ReplyError};
|
|
||||||
use x11rb::protocol::{
|
use x11rb::protocol::{
|
||||||
xinput::{self, ConnectionExt as _},
|
xinput::{self, ConnectionExt as _},
|
||||||
xkb::{self, ConnectionExt as _},
|
xkb,
|
||||||
};
|
};
|
||||||
|
|
||||||
use super::*;
|
use super::*;
|
||||||
|
|
@ -38,31 +37,16 @@ impl XConnection {
|
||||||
device_id: xkb::DeviceSpec,
|
device_id: xkb::DeviceSpec,
|
||||||
mask: xkb::EventType,
|
mask: xkb::EventType,
|
||||||
) -> Result<bool, X11Error> {
|
) -> Result<bool, X11Error> {
|
||||||
let result = self
|
let mask = u16::from(mask) as _;
|
||||||
.xcb_connection()
|
let status =
|
||||||
.xkb_select_events(
|
unsafe { (self.xlib.XkbSelectEvents)(self.display, device_id as _, mask, mask) };
|
||||||
device_id,
|
|
||||||
xkb::EventType::from(0u8),
|
|
||||||
mask,
|
|
||||||
xkb::MapPart::from(u16::from(mask)),
|
|
||||||
xkb::MapPart::EXPLICIT_COMPONENTS
|
|
||||||
| xkb::MapPart::KEY_ACTIONS
|
|
||||||
| xkb::MapPart::KEY_BEHAVIORS
|
|
||||||
| xkb::MapPart::VIRTUAL_MODS
|
|
||||||
| xkb::MapPart::MODIFIER_MAP
|
|
||||||
| xkb::MapPart::VIRTUAL_MOD_MAP,
|
|
||||||
&xkb::SelectEventsAux::new(),
|
|
||||||
)
|
|
||||||
.map_err(ReplyError::from)
|
|
||||||
.and_then(|x| x.check());
|
|
||||||
|
|
||||||
match result {
|
if status == ffi::True {
|
||||||
Ok(()) => Ok(true),
|
self.flush_requests()?;
|
||||||
Err(ReplyError::ConnectionError(ConnectionError::UnsupportedExtension)) => {
|
Ok(true)
|
||||||
error!("Could not select XKB events: The XKB extension is not initialized!");
|
} else {
|
||||||
Ok(false)
|
error!("Could not select XKB events: The XKB extension is not initialized!");
|
||||||
}
|
Ok(false)
|
||||||
Err(e) => Err(e.into()),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue