Struct XxInputPopupSurfaceV2
pub struct XxInputPopupSurfaceV2 { /* private fields */ }wayland and Linux only.Expand description
popup surface
An input method popup surface is a short-lived, temporary surface. It is meant as an area to show suggestions, candidates, or for other input-related uses.
The compositor should anchor it at the active text input cursor area.
The client must call wl_surface.commit on the corresponding wl_surface for input_popup_surface state updates to take effect, unless otherwise noted.
After the initial wl_surface.commit, the compositor must reply with a configure sequence (see .start_configure) initializing all the compositor-provided state of the popup. That means providing values for:
- width
- height
- anchor_x
- anchor_y
- anchor_width
- anchor_height
- serial
using the appropriate events.
The popup will only be presented to the user after the client receives the configure sequence and replies with .ack_configure.
An example init sequence could look like this:
- client (Cl): popup = input_method.get_popup(wl_surface, positioner)
- Cl: wl_surface.commit()
- compositor (Co): popup.start_configure(150, 150, 10, -2, 5, 30)
- Co: input_method.done()
- Cl: ack_configure()
- Cl: wl_surface.commit()
A newly created input_popup_surface will be stacked on top of all previously created input_popup_surfaces associated with the same text input.
A typical sequence resulting from the user selecting a new text field and typing some text:
- compositor (Co): input_method.enable()
- Co: input_method.done()
- [init sequence]
- Co: input_method.set_surrounding_text(“new text”)
- Co: popup.start_configure(150, 150, -60, -2, 55, 30)
- Co: input_method.done()
- client (Cl): ack_configure()
- Cl: wl_surface.commit()
When the corresponding input_method receives a commited .disable event, the popup gets destroyed and becomes invalid and its surface gets unmapped.
The client must not destroy the underlying wl_surface while the xx_input_popup_surface_v2 object exists.
See also the Event enum for this interface.
Implementations§
§impl XxInputPopupSurfaceV2
impl XxInputPopupSurfaceV2
pub fn ack_configure(&self, serial: u32)
pub fn ack_configure(&self, serial: u32)
acknowledge a configure sequence
This request notifies the compositor that the client updated its surface in response to a configure sequence.
The purpose of this request is to synchronize the updates of the surface geometry with the surface contents. For example, when the compositor assigns a size larger than prevously, the client must fill the additional space before the popup gets displayed to the user with the new size. When the compositor receives .ack_configure, it can proceed to draw the new size.
.ack_configure should be sent after every submitted configure sequence, passing along the serial received in it.
An .ack_configure request is conceptually double-buffered. Every request overrides the previous one. The request takes effect once the .commit request is sent on the corresponding surface.
If the client receives multiple configure sequences before it can respond to one, it may acknowledge only the last configure sequence by using its serial in the .ack_configure request.
Committing an .ack_configure request consumes the serial number sent with the request, as well as serial numbers sent by all configure sequences submitted on this input_popup_surface prior to the configure sequence referenced by the committed serial.
Committing this request with a serial that, for this surface, never appeared in a submitted configure sequence, or one that was already committed before, raises an invalid_serial error.
pub fn reposition(&self, positioner: &XxInputPopupPositionerV1, token: u32)
pub fn reposition(&self, positioner: &XxInputPopupPositionerV1, token: u32)
recalculate the popup’s location
Reposition an already-mapped popup. The popup will be placed given the details in the passed input_popup_positioner object.
The request is processed immediately, without the need to issue wl_surface.commit, but the actual repositioning takes place later, after .ack_configure.
The compositor should reply with a configure sequence including:
- input_popup_surface.start_configure,
- input_popup_surface.repositioned, including the token passed in this request.
This will discard any parameters set by the previous positioner.
If multiple .reposition requests are sent before the .repositioned event is submitted as part of a configure sequence, the compositor may ignore all but the last one.
The new popup position will not take effect until the corresponding configure sequence is acknowledged by the client. See input_popup_surface.repositioned for details.
The token itself is opaque, and has no other special meaning.
pub fn destroy(&self)
pub fn destroy(&self)
remove the popup
This destroys the popup. Explicitly destroying the input_popup_surface object will also dismiss the popup, and unmap the surface.
Trait Implementations§
§impl Borrow<ObjectId> for XxInputPopupSurfaceV2
impl Borrow<ObjectId> for XxInputPopupSurfaceV2
§impl Clone for XxInputPopupSurfaceV2
impl Clone for XxInputPopupSurfaceV2
§fn clone(&self) -> XxInputPopupSurfaceV2
fn clone(&self) -> XxInputPopupSurfaceV2
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for XxInputPopupSurfaceV2
impl Debug for XxInputPopupSurfaceV2
§impl<D> Dispatch<XxInputPopupSurfaceV2, PopupData, D> for Popup
impl<D> Dispatch<XxInputPopupSurfaceV2, PopupData, D> for Popup
§fn event(
_data: &mut D,
popup: &XxInputPopupSurfaceV2,
event: Event,
udata: &PopupData,
_conn: &Connection,
_qh: &QueueHandle<D>,
)
fn event( _data: &mut D, popup: &XxInputPopupSurfaceV2, event: Event, udata: &PopupData, _conn: &Connection, _qh: &QueueHandle<D>, )
§fn event_created_child(
opcode: u16,
_qhandle: &QueueHandle<State>,
) -> Arc<dyn ObjectData>
fn event_created_child( opcode: u16, _qhandle: &QueueHandle<State>, ) -> Arc<dyn ObjectData>
§impl Hash for XxInputPopupSurfaceV2
impl Hash for XxInputPopupSurfaceV2
§impl PartialEq<Weak<XxInputPopupSurfaceV2>> for XxInputPopupSurfaceV2
impl PartialEq<Weak<XxInputPopupSurfaceV2>> for XxInputPopupSurfaceV2
§impl PartialEq for XxInputPopupSurfaceV2
impl PartialEq for XxInputPopupSurfaceV2
§impl Proxy for XxInputPopupSurfaceV2
impl Proxy for XxInputPopupSurfaceV2
§fn object_data(&self) -> Option<&Arc<dyn ObjectData>>
fn object_data(&self) -> Option<&Arc<dyn ObjectData>>
§fn backend(&self) -> &WeakBackend
fn backend(&self) -> &WeakBackend
§fn send_request(
&self,
req: <XxInputPopupSurfaceV2 as Proxy>::Request<'_>,
) -> Result<(), InvalidId>
fn send_request( &self, req: <XxInputPopupSurfaceV2 as Proxy>::Request<'_>, ) -> Result<(), InvalidId>
§fn send_constructor<I>(
&self,
req: <XxInputPopupSurfaceV2 as Proxy>::Request<'_>,
data: Arc<dyn ObjectData>,
) -> Result<I, InvalidId>where
I: Proxy,
fn send_constructor<I>(
&self,
req: <XxInputPopupSurfaceV2 as Proxy>::Request<'_>,
data: Arc<dyn ObjectData>,
) -> Result<I, InvalidId>where
I: Proxy,
§fn from_id(
conn: &Connection,
id: ObjectId,
) -> Result<XxInputPopupSurfaceV2, InvalidId>
fn from_id( conn: &Connection, id: ObjectId, ) -> Result<XxInputPopupSurfaceV2, InvalidId>
§fn inert(backend: WeakBackend) -> XxInputPopupSurfaceV2
fn inert(backend: WeakBackend) -> XxInputPopupSurfaceV2
§fn parse_event(
conn: &Connection,
msg: Message<ObjectId, OwnedFd>,
) -> Result<(XxInputPopupSurfaceV2, <XxInputPopupSurfaceV2 as Proxy>::Event), DispatchError>
fn parse_event( conn: &Connection, msg: Message<ObjectId, OwnedFd>, ) -> Result<(XxInputPopupSurfaceV2, <XxInputPopupSurfaceV2 as Proxy>::Event), DispatchError>
§fn write_request<'a>(
&self,
conn: &Connection,
msg: <XxInputPopupSurfaceV2 as Proxy>::Request<'a>,
) -> Result<(Message<ObjectId, BorrowedFd<'a>>, Option<(&'static Interface, u32)>), InvalidId>
fn write_request<'a>( &self, conn: &Connection, msg: <XxInputPopupSurfaceV2 as Proxy>::Request<'a>, ) -> Result<(Message<ObjectId, BorrowedFd<'a>>, Option<(&'static Interface, u32)>), InvalidId>
impl Eq for XxInputPopupSurfaceV2
Auto Trait Implementations§
impl Freeze for XxInputPopupSurfaceV2
impl !RefUnwindSafe for XxInputPopupSurfaceV2
impl Send for XxInputPopupSurfaceV2
impl Sync for XxInputPopupSurfaceV2
impl Unpin for XxInputPopupSurfaceV2
impl !UnwindSafe for XxInputPopupSurfaceV2
Blanket Implementations§
Source§impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for Swhere
T: Real + Zero + Arithmetics + Clone,
Swp: WhitePoint<T>,
Dwp: WhitePoint<T>,
D: AdaptFrom<S, Swp, Dwp, T>,
impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for Swhere
T: Real + Zero + Arithmetics + Clone,
Swp: WhitePoint<T>,
Dwp: WhitePoint<T>,
D: AdaptFrom<S, Swp, Dwp, T>,
Source§fn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<T>,
fn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<T>,
Source§fn adapt_into(self) -> D
fn adapt_into(self) -> D
§impl<T> AnyEq for T
impl<T> AnyEq for T
§impl<T, Res> Apply<Res> for Twhere
T: ?Sized,
impl<T, Res> Apply<Res> for Twhere
T: ?Sized,
Source§impl<T, C> ArraysFrom<C> for Twhere
C: IntoArrays<T>,
impl<T, C> ArraysFrom<C> for Twhere
C: IntoArrays<T>,
Source§fn arrays_from(colors: C) -> T
fn arrays_from(colors: C) -> T
Source§impl<T, C> ArraysInto<C> for Twhere
C: FromArrays<T>,
impl<T, C> ArraysInto<C> for Twhere
C: FromArrays<T>,
Source§fn arrays_into(self) -> C
fn arrays_into(self) -> C
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<WpParam, T, U> Cam16IntoUnclamped<WpParam, T> for Uwhere
T: FromCam16Unclamped<WpParam, U>,
impl<WpParam, T, U> Cam16IntoUnclamped<WpParam, T> for Uwhere
T: FromCam16Unclamped<WpParam, U>,
Source§type Scalar = <T as FromCam16Unclamped<WpParam, U>>::Scalar
type Scalar = <T as FromCam16Unclamped<WpParam, U>>::Scalar
parameters when converting.Source§fn cam16_into_unclamped(
self,
parameters: BakedParameters<WpParam, <U as Cam16IntoUnclamped<WpParam, T>>::Scalar>,
) -> T
fn cam16_into_unclamped( self, parameters: BakedParameters<WpParam, <U as Cam16IntoUnclamped<WpParam, T>>::Scalar>, ) -> T
self into C, using the provided parameters.Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T, C> ComponentsFrom<C> for Twhere
C: IntoComponents<T>,
impl<T, C> ComponentsFrom<C> for Twhere
C: IntoComponents<T>,
Source§fn components_from(colors: C) -> T
fn components_from(colors: C) -> T
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> FromAngle<T> for T
impl<T> FromAngle<T> for T
Source§fn from_angle(angle: T) -> T
fn from_angle(angle: T) -> T
angle.Source§impl<T, U> FromStimulus<U> for Twhere
U: IntoStimulus<T>,
impl<T, U> FromStimulus<U> for Twhere
U: IntoStimulus<T>,
Source§fn from_stimulus(other: U) -> T
fn from_stimulus(other: U) -> T
other into Self, while performing the appropriate scaling,
rounding and clamping.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T, U> IntoAngle<U> for Twhere
U: FromAngle<T>,
impl<T, U> IntoAngle<U> for Twhere
U: FromAngle<T>,
Source§fn into_angle(self) -> U
fn into_angle(self) -> U
T.§impl<State, Message> IntoBoot<State, Message> for State
impl<State, Message> IntoBoot<State, Message> for State
§fn into_boot(self) -> (State, Task<Message>)
fn into_boot(self) -> (State, Task<Message>)
Application.Source§impl<WpParam, T, U> IntoCam16Unclamped<WpParam, T> for Uwhere
T: Cam16FromUnclamped<WpParam, U>,
impl<WpParam, T, U> IntoCam16Unclamped<WpParam, T> for Uwhere
T: Cam16FromUnclamped<WpParam, U>,
Source§type Scalar = <T as Cam16FromUnclamped<WpParam, U>>::Scalar
type Scalar = <T as Cam16FromUnclamped<WpParam, U>>::Scalar
parameters when converting.Source§fn into_cam16_unclamped(
self,
parameters: BakedParameters<WpParam, <U as IntoCam16Unclamped<WpParam, T>>::Scalar>,
) -> T
fn into_cam16_unclamped( self, parameters: BakedParameters<WpParam, <U as IntoCam16Unclamped<WpParam, T>>::Scalar>, ) -> T
self into C, using the provided parameters.Source§impl<T, U> IntoColor<U> for Twhere
U: FromColor<T>,
impl<T, U> IntoColor<U> for Twhere
U: FromColor<T>,
Source§fn into_color(self) -> U
fn into_color(self) -> U
Source§impl<T, U> IntoColorUnclamped<U> for Twhere
U: FromColorUnclamped<T>,
impl<T, U> IntoColorUnclamped<U> for Twhere
U: FromColorUnclamped<T>,
Source§fn into_color_unclamped(self) -> U
fn into_color_unclamped(self) -> U
Source§impl<T> IntoStimulus<T> for T
impl<T> IntoStimulus<T> for T
Source§fn into_stimulus(self) -> T
fn into_stimulus(self) -> T
self into T, while performing the appropriate scaling,
rounding and clamping.Source§impl<T, C> TryComponentsInto<C> for Twhere
C: TryFromComponents<T>,
impl<T, C> TryComponentsInto<C> for Twhere
C: TryFromComponents<T>,
Source§type Error = <C as TryFromComponents<T>>::Error
type Error = <C as TryFromComponents<T>>::Error
try_into_colors fails to cast.Source§fn try_components_into(self) -> Result<C, <T as TryComponentsInto<C>>::Error>
fn try_components_into(self) -> Result<C, <T as TryComponentsInto<C>>::Error>
Source§impl<T, U> TryIntoColor<U> for Twhere
U: TryFromColor<T>,
impl<T, U> TryIntoColor<U> for Twhere
U: TryFromColor<T>,
Source§fn try_into_color(self) -> Result<U, OutOfBounds<U>>
fn try_into_color(self) -> Result<U, OutOfBounds<U>>
OutOfBounds error is returned which contains
the unclamped color. Read more