1
0
Fork 0
forked from wry/wry

Merge pull request #209 from mahkoh/jorth/input-method-cap

wayland: restrict input method global to privileged applications
This commit is contained in:
mahkoh 2024-05-30 13:02:53 +02:00 committed by GitHub
commit 53b7d3c805
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 10 additions and 2 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);

View file

@ -237,7 +237,10 @@ impl GbmDevice {
return Err(GbmError::CreateBo(OsError::default()));
}
let bo = BoHolder { bo };
let dma = export_bo(dma_buf_ids, bo.bo)?;
let mut dma = export_bo(dma_buf_ids, bo.bo)?;
if modifiers.is_null() {
dma.modifier = INVALID_MODIFIER;
}
Ok(GbmBo { bo, dmabuf: dma })
}
}