1
0
Fork 0
forked from wry/wry

wayland: restrict input method global to privileged applications

This commit is contained in:
Julian Orth 2024-05-30 11:28:45 +02:00
parent 077651dd80
commit be5c2bc99a
2 changed files with 6 additions and 1 deletions

View file

@ -56,6 +56,7 @@ bitflags! {
CAP_SCREENCOPY_MANAGER = 1 << 7,
CAP_SEAT_MANAGER = 1 << 8,
CAP_DRM_LEASE = 1 << 9,
CAP_INPUT_METHOD = 1 << 10,
}
pub const CAPS_DEFAULT: ClientCaps = ClientCaps(CAP_LAYER_SHELL.0 | CAP_DRM_LEASE.0);

View file

@ -1,6 +1,6 @@
use {
crate::{
client::{Client, ClientError},
client::{Client, ClientCaps, ClientError, CAP_INPUT_METHOD},
globals::{Global, GlobalName},
ifs::wl_seat::text_input::{zwp_input_method_v2::ZwpInputMethodV2, TextConnectReason},
leaks::Tracker,
@ -59,6 +59,10 @@ impl Global for ZwpInputMethodManagerV2Global {
fn version(&self) -> u32 {
1
}
fn required_caps(&self) -> ClientCaps {
CAP_INPUT_METHOD
}
}
simple_add_global!(ZwpInputMethodManagerV2Global);