1
0
Fork 0
forked from wry/wry

ei: add support for libei

This commit is contained in:
Julian Orth 2024-07-24 01:38:05 +02:00
parent 084fe50259
commit 40e87f8f91
69 changed files with 4340 additions and 72 deletions

View file

@ -992,6 +992,10 @@ impl Client {
keymap
}
pub fn set_ei_socket_enabled(&self, enabled: bool) {
self.send(&ClientMessage::SetEiSocketEnabled { enabled })
}
pub fn latch<F: FnOnce() + 'static>(&self, seat: Seat, f: F) {
if !self.feat_mod_mask.get() {
log::error!("compositor does not support latching");

View file

@ -506,6 +506,9 @@ pub enum ClientMessage<'a> {
device: InputDevice,
matrix: [[f32; 3]; 2],
},
SetEiSocketEnabled {
enabled: bool,
},
}
#[derive(Serialize, Deserialize, Debug)]

View file

@ -564,3 +564,12 @@ pub enum SwitchEvent {
/// event of this kind is generated.
ConvertedToTablet,
}
/// Enables or disables the unauthenticated libei socket.
///
/// Even if the socket is disabled, application can still request access via the portal.
///
/// The default is `false`.
pub fn set_libei_socket_enabled(enabled: bool) {
get!().set_ei_socket_enabled(enabled);
}