pub enum FocusTarget {
Window(Window),
Popup(PopupKind),
LayerSurface(LayerSurface),
Subsurface(WlSurface, Box<FocusTarget>),
}Expand description
Input-event target for Smithay’s seat handlers. Smithay requires a concrete type as the
“target” of a keyboard / pointer / touch event; FocusTarget bridges that to the concrete
Wayland surface behind a window, popup, or layer surface.
Variants§
Window(Window)
Popup(PopupKind)
LayerSurface(LayerSurface)
Subsurface(WlSurface, Box<FocusTarget>)
A subsurface under the pointer, which takes the pointer’s events on its own surface (a browser draws its permission and menu bubbles so), with the window, popup, or layer surface it belongs to, which everything but those events goes by: the keyboard, the window policy, a grab’s window.
Implementations§
Source§impl FocusTarget
impl FocusTarget
Sourcepub(crate) fn owner(&self) -> &FocusTarget
pub(crate) fn owner(&self) -> &FocusTarget
The window, popup, or layer surface this target is, or a subsurface belongs to.
Sourcefn under_point(
self,
origin: Point<f64, Logical>,
p: Point<f64, Logical>,
) -> (FocusTarget, Point<f64, Logical>)
fn under_point( self, origin: Point<f64, Logical>, p: Point<f64, Logical>, ) -> (FocusTarget, Point<f64, Logical>)
This target, or the subsurface of its surface tree that takes input at the logical
point p where one does, with the origin pointer events there are local to; origin
is where this target’s own surface lies. A point the tree takes no input at leaves the
target as it is.
Trait Implementations§
Source§impl Clone for FocusTarget
impl Clone for FocusTarget
Source§fn clone(&self) -> FocusTarget
fn clone(&self) -> FocusTarget
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for FocusTarget
impl Debug for FocusTarget
Source§impl DndFocus<AppState> for FocusTarget
Forward drag-and-drop focus events (enter / motion / leave / drop) to the wrapped
target’s underlying wl_surface, reusing the WlSurface offer-data type.
impl DndFocus<AppState> for FocusTarget
Forward drag-and-drop focus events (enter / motion / leave / drop) to the wrapped
target’s underlying wl_surface, reusing the WlSurface offer-data type.
Source§type OfferData<S: Source> = <WlSurface as DndFocus<AppState>>::OfferData<S>
type OfferData<S: Source> = <WlSurface as DndFocus<AppState>>::OfferData<S>
Source§fn enter<S: Source>(
&self,
data: &mut AppState,
dh: &DisplayHandle,
source: Arc<S>,
seat: &Seat<AppState>,
location: Point<f64, Logical>,
serial: &Serial,
) -> Option<Self::OfferData<S>>
fn enter<S: Source>( &self, data: &mut AppState, dh: &DisplayHandle, source: Arc<S>, seat: &Seat<AppState>, location: Point<f64, Logical>, serial: &Serial, ) -> Option<Self::OfferData<S>>
Source§fn motion<S: Source>(
&self,
data: &mut AppState,
offer: Option<&mut Self::OfferData<S>>,
seat: &Seat<AppState>,
location: Point<f64, Logical>,
time: InputTime,
)
fn motion<S: Source>( &self, data: &mut AppState, offer: Option<&mut Self::OfferData<S>>, seat: &Seat<AppState>, location: Point<f64, Logical>, time: InputTime, )
Source§impl From<LayerSurface> for FocusTarget
Wrap a layer surface as a focus target.
impl From<LayerSurface> for FocusTarget
Wrap a layer surface as a focus target.
Source§impl From<PopupKind> for FocusTarget
Wrap a popup as a focus target.
impl From<PopupKind> for FocusTarget
Wrap a popup as a focus target.
Source§impl From<Window> for FocusTarget
Wrap a Window as a focus target.
impl From<Window> for FocusTarget
Wrap a Window as a focus target.
Source§impl IsAlive for FocusTarget
Liveness of a focus target: true while its underlying window / popup / layer surface is
still alive, so dead targets are dropped from focus.
impl IsAlive for FocusTarget
Liveness of a focus target: true while its underlying window / popup / layer surface is still alive, so dead targets are dropped from focus.
Source§impl KeyboardTarget<AppState> for FocusTarget
Forward every keyboard event (enter / leave / key / modifiers) to the wrapped target’s
underlying wl_surface, which carries Smithay’s real keyboard-target implementation; a
subsurface’s events go to the surface it belongs to, since keyboard focus is a whole
window’s.
impl KeyboardTarget<AppState> for FocusTarget
Forward every keyboard event (enter / leave / key / modifiers) to the wrapped target’s
underlying wl_surface, which carries Smithay’s real keyboard-target implementation; a
subsurface’s events go to the surface it belongs to, since keyboard focus is a whole
window’s.
Source§fn enter(
&self,
seat: &Seat<AppState>,
data: &mut AppState,
keys: Vec<KeysymHandle<'_>>,
serial: Serial,
)
fn enter( &self, seat: &Seat<AppState>, data: &mut AppState, keys: Vec<KeysymHandle<'_>>, serial: Serial, )
Source§fn leave(&self, seat: &Seat<AppState>, data: &mut AppState, serial: Serial)
fn leave(&self, seat: &Seat<AppState>, data: &mut AppState, serial: Serial)
Source§fn key(
&self,
seat: &Seat<AppState>,
data: &mut AppState,
key: KeysymHandle<'_>,
state: KeyState,
serial: Serial,
time: InputTime,
)
fn key( &self, seat: &Seat<AppState>, data: &mut AppState, key: KeysymHandle<'_>, state: KeyState, serial: Serial, time: InputTime, )
Source§impl PartialEq for FocusTarget
impl PartialEq for FocusTarget
Source§impl PointerTarget<AppState> for FocusTarget
Forward every pointer event (motion, buttons, axis, and all swipe / pinch / hold gesture
phases) to the wrapped target’s underlying wl_surface.
impl PointerTarget<AppState> for FocusTarget
Forward every pointer event (motion, buttons, axis, and all swipe / pinch / hold gesture
phases) to the wrapped target’s underlying wl_surface.
Source§fn enter(&self, seat: &Seat<AppState>, data: &mut AppState, event: &MotionEvent)
fn enter(&self, seat: &Seat<AppState>, data: &mut AppState, event: &MotionEvent)
Source§fn motion(
&self,
seat: &Seat<AppState>,
data: &mut AppState,
event: &MotionEvent,
)
fn motion( &self, seat: &Seat<AppState>, data: &mut AppState, event: &MotionEvent, )
Source§fn relative_motion(
&self,
seat: &Seat<AppState>,
data: &mut AppState,
event: &RelativeMotionEvent,
)
fn relative_motion( &self, seat: &Seat<AppState>, data: &mut AppState, event: &RelativeMotionEvent, )
Source§fn axis(&self, seat: &Seat<AppState>, data: &mut AppState, frame: AxisFrame)
fn axis(&self, seat: &Seat<AppState>, data: &mut AppState, frame: AxisFrame)
Source§fn leave(
&self,
seat: &Seat<AppState>,
data: &mut AppState,
serial: Serial,
time: InputTime,
)
fn leave( &self, seat: &Seat<AppState>, data: &mut AppState, serial: Serial, time: InputTime, )
Source§fn gesture_swipe_begin(
&self,
seat: &Seat<AppState>,
data: &mut AppState,
event: &GestureSwipeBeginEvent,
)
fn gesture_swipe_begin( &self, seat: &Seat<AppState>, data: &mut AppState, event: &GestureSwipeBeginEvent, )
Source§fn gesture_swipe_update(
&self,
seat: &Seat<AppState>,
data: &mut AppState,
event: &GestureSwipeUpdateEvent,
)
fn gesture_swipe_update( &self, seat: &Seat<AppState>, data: &mut AppState, event: &GestureSwipeUpdateEvent, )
Source§fn gesture_swipe_end(
&self,
seat: &Seat<AppState>,
data: &mut AppState,
event: &GestureSwipeEndEvent,
)
fn gesture_swipe_end( &self, seat: &Seat<AppState>, data: &mut AppState, event: &GestureSwipeEndEvent, )
Source§fn gesture_pinch_begin(
&self,
seat: &Seat<AppState>,
data: &mut AppState,
event: &GesturePinchBeginEvent,
)
fn gesture_pinch_begin( &self, seat: &Seat<AppState>, data: &mut AppState, event: &GesturePinchBeginEvent, )
Source§fn gesture_pinch_update(
&self,
seat: &Seat<AppState>,
data: &mut AppState,
event: &GesturePinchUpdateEvent,
)
fn gesture_pinch_update( &self, seat: &Seat<AppState>, data: &mut AppState, event: &GesturePinchUpdateEvent, )
Source§fn gesture_pinch_end(
&self,
seat: &Seat<AppState>,
data: &mut AppState,
event: &GesturePinchEndEvent,
)
fn gesture_pinch_end( &self, seat: &Seat<AppState>, data: &mut AppState, event: &GesturePinchEndEvent, )
Source§fn gesture_hold_begin(
&self,
seat: &Seat<AppState>,
data: &mut AppState,
event: &GestureHoldBeginEvent,
)
fn gesture_hold_begin( &self, seat: &Seat<AppState>, data: &mut AppState, event: &GestureHoldBeginEvent, )
Source§fn gesture_hold_end(
&self,
seat: &Seat<AppState>,
data: &mut AppState,
event: &GestureHoldEndEvent,
)
fn gesture_hold_end( &self, seat: &Seat<AppState>, data: &mut AppState, event: &GestureHoldEndEvent, )
impl StructuralPartialEq for FocusTarget
Source§impl TouchTarget<AppState> for FocusTarget
Forward every touch event (down / up / motion / frame / cancel / shape / orientation) to
the wrapped target’s underlying wl_surface.
impl TouchTarget<AppState> for FocusTarget
Forward every touch event (down / up / motion / frame / cancel / shape / orientation) to
the wrapped target’s underlying wl_surface.
Source§fn down(&self, seat: &Seat<AppState>, data: &mut AppState, event: &DownEvent)
fn down(&self, seat: &Seat<AppState>, data: &mut AppState, event: &DownEvent)
Source§fn up(&self, seat: &Seat<AppState>, data: &mut AppState, event: &UpEvent)
fn up(&self, seat: &Seat<AppState>, data: &mut AppState, event: &UpEvent)
Source§fn motion(
&self,
seat: &Seat<AppState>,
data: &mut AppState,
event: &MotionEvent,
)
fn motion( &self, seat: &Seat<AppState>, data: &mut AppState, event: &MotionEvent, )
Source§fn frame(&self, seat: &Seat<AppState>, data: &mut AppState, marker: FrameMarker)
fn frame(&self, seat: &Seat<AppState>, data: &mut AppState, marker: FrameMarker)
Source§fn cancel(
&self,
seat: &Seat<AppState>,
data: &mut AppState,
marker: FrameMarker,
)
fn cancel( &self, seat: &Seat<AppState>, data: &mut AppState, marker: FrameMarker, )
Source§fn shape(&self, seat: &Seat<AppState>, data: &mut AppState, event: &ShapeEvent)
fn shape(&self, seat: &Seat<AppState>, data: &mut AppState, event: &ShapeEvent)
Source§impl WaylandFocus for FocusTarget
Expose the wrapped target’s underlying wl_surface and same-client checks so Smithay
can route focus and selection ownership by client.
impl WaylandFocus for FocusTarget
Expose the wrapped target’s underlying wl_surface and same-client checks so Smithay
can route focus and selection ownership by client.
Auto Trait Implementations§
impl !RefUnwindSafe for FocusTarget
impl !UnwindSafe for FocusTarget
impl Freeze for FocusTarget
impl Send for FocusTarget
impl Sync for FocusTarget
impl Unpin for FocusTarget
impl UnsafeUnpin for FocusTarget
Blanket Implementations§
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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<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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more