seat: implement input methods
This commit is contained in:
parent
5e2cdef388
commit
daf52299db
44 changed files with 2165 additions and 75 deletions
|
|
@ -12,6 +12,7 @@ pub mod xdg_surface;
|
|||
pub mod xwayland_shell_v1;
|
||||
pub mod zwlr_layer_surface_v1;
|
||||
pub mod zwp_idle_inhibitor_v1;
|
||||
pub mod zwp_input_popup_surface_v2;
|
||||
|
||||
use {
|
||||
crate::{
|
||||
|
|
@ -24,8 +25,9 @@ use {
|
|||
wl_buffer::WlBuffer,
|
||||
wl_callback::WlCallback,
|
||||
wl_seat::{
|
||||
wl_pointer::PendingScroll, zwp_pointer_constraints_v1::SeatConstraint, Dnd,
|
||||
NodeSeatState, SeatId, WlSeatGlobal,
|
||||
text_input::TextInputConnection, wl_pointer::PendingScroll,
|
||||
zwp_pointer_constraints_v1::SeatConstraint, Dnd, NodeSeatState, SeatId,
|
||||
WlSeatGlobal,
|
||||
},
|
||||
wl_surface::{
|
||||
commit_timeline::{ClearReason, CommitTimeline, CommitTimelineError},
|
||||
|
|
@ -104,6 +106,7 @@ pub enum SurfaceRole {
|
|||
ZwlrLayerSurface,
|
||||
XSurface,
|
||||
ExtSessionLockSurface,
|
||||
InputPopup,
|
||||
}
|
||||
|
||||
impl SurfaceRole {
|
||||
|
|
@ -117,6 +120,7 @@ impl SurfaceRole {
|
|||
SurfaceRole::ZwlrLayerSurface => "zwlr_layer_surface",
|
||||
SurfaceRole::XSurface => "xwayland surface",
|
||||
SurfaceRole::ExtSessionLockSurface => "ext_session_lock_surface",
|
||||
SurfaceRole::InputPopup => "input_popup_surface",
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -249,6 +253,7 @@ pub struct WlSurface {
|
|||
commit_timeline: CommitTimeline,
|
||||
alpha_modifier: CloneCell<Option<Rc<WpAlphaModifierSurfaceV1>>>,
|
||||
alpha: Cell<Option<f32>>,
|
||||
pub text_input_connections: SmallMap<SeatId, Rc<TextInputConnection>, 1>,
|
||||
}
|
||||
|
||||
impl Debug for WlSurface {
|
||||
|
|
@ -533,6 +538,7 @@ impl WlSurface {
|
|||
commit_timeline: client.commit_timelines.create_timeline(),
|
||||
alpha_modifier: Default::default(),
|
||||
alpha: Default::default(),
|
||||
text_input_connections: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -604,6 +610,11 @@ impl WlSurface {
|
|||
.set_absolute_position(x1 + pos.x1(), y1 + pos.y1());
|
||||
}
|
||||
}
|
||||
for (_, con) in &self.text_input_connections {
|
||||
for (_, popup) in &con.input_method.popups {
|
||||
popup.schedule_positioning();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn add_presentation_feedback(&self, fb: &Rc<WpPresentationFeedback>) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue