Struct x11rb_protocol::protocol::xproto::GrabButtonRequest
source · [−]pub struct GrabButtonRequest {
pub owner_events: bool,
pub grab_window: Window,
pub event_mask: u16,
pub pointer_mode: GrabMode,
pub keyboard_mode: GrabMode,
pub confine_to: Window,
pub cursor: Cursor,
pub button: ButtonIndex,
pub modifiers: u16,
}
Expand description
Grab pointer button(s).
This request establishes a passive grab. The pointer is actively grabbed as described in GrabPointer, the last-pointer-grab time is set to the time at which the button was pressed (as transmitted in the ButtonPress event), and the ButtonPress event is reported if all of the following conditions are true:
The pointer is not grabbed and the specified button is logically pressed when the specified modifier keys are logically down, and no other buttons or modifier keys are logically down.
The grab-window contains the pointer.
The confine-to window (if any) is viewable.
A passive grab on the same button/key combination does not exist on any ancestor of grab-window.
The interpretation of the remaining arguments is the same as for GrabPointer. The active grab is terminated automatically when the logical state of the pointer has all buttons released, independent of the logical state of modifier keys. Note that the logical state of a device (as seen by means of the protocol) may lag the physical state if device event processing is frozen. This request overrides all previous passive grabs by the same client on the same button/key combinations on the same window. A modifier of AnyModifier is equivalent to issuing the request for all possible modifier combinations (including the combination of no modifiers). It is not required that all specified modifiers have currently assigned keycodes. A button of AnyButton is equivalent to issuing the request for all possible buttons. Otherwise, it is not required that the button specified currently be assigned to a physical button.
An Access error is generated if some other client has already issued a GrabButton request with the same button/key combination on the same window. When using AnyModifier or AnyButton, the request fails completely (no grabs are established), and an Access error is generated if there is a conflicting grab for any combination. The request has no effect on an active grab.
Fields
owner_events
- If 1, thegrab_window
will still get the pointer events. If 0, events are not reported to thegrab_window
.grab_window
- Specifies the window on which the pointer should be grabbed.event_mask
- Specifies which pointer events are reported to the client.
TODO: which values?
confine_to
- Specifies the window to confine the pointer in (the user will not be able to move the pointer out of that window).
The special value XCB_NONE
means don’t confine the pointer.
cursor
- Specifies the cursor that should be displayed orXCB_NONE
to not change the cursor.modifiers
- The modifiers to grab.
Using the special value XCB_MOD_MASK_ANY
means grab the pointer with all
possible modifier combinations.
pointer_mode
-keyboard_mode
-button
-
Errors
Access
- Another client has already issued a GrabButton with the same button/key combination on the same window.Value
- TODO: reasons?Cursor
- The specifiedcursor
does not exist.Window
- The specifiedwindow
does not exist.
Fields
owner_events: bool
grab_window: Window
event_mask: u16
pointer_mode: GrabMode
keyboard_mode: GrabMode
confine_to: Window
cursor: Cursor
modifiers: u16
Implementations
sourceimpl GrabButtonRequest
impl GrabButtonRequest
sourcepub fn serialize(self) -> BufWithFds<PiecewiseBuf<'static>>
pub fn serialize(self) -> BufWithFds<PiecewiseBuf<'static>>
Serialize this request into bytes for the provided connection
sourcepub fn try_parse_request(
header: RequestHeader,
value: &[u8]
) -> Result<Self, ParseError>
pub fn try_parse_request(
header: RequestHeader,
value: &[u8]
) -> Result<Self, ParseError>
Parse this request given its header, its body, and any fds that go along with it
Trait Implementations
sourceimpl Clone for GrabButtonRequest
impl Clone for GrabButtonRequest
sourcefn clone(&self) -> GrabButtonRequest
fn clone(&self) -> GrabButtonRequest
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for GrabButtonRequest
impl Debug for GrabButtonRequest
sourceimpl Default for GrabButtonRequest
impl Default for GrabButtonRequest
sourcefn default() -> GrabButtonRequest
fn default() -> GrabButtonRequest
Returns the “default value” for a type. Read more
sourceimpl Hash for GrabButtonRequest
impl Hash for GrabButtonRequest
sourceimpl Ord for GrabButtonRequest
impl Ord for GrabButtonRequest
sourceimpl PartialEq<GrabButtonRequest> for GrabButtonRequest
impl PartialEq<GrabButtonRequest> for GrabButtonRequest
sourcefn eq(&self, other: &GrabButtonRequest) -> bool
fn eq(&self, other: &GrabButtonRequest) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &GrabButtonRequest) -> bool
fn ne(&self, other: &GrabButtonRequest) -> bool
This method tests for !=
.
sourceimpl PartialOrd<GrabButtonRequest> for GrabButtonRequest
impl PartialOrd<GrabButtonRequest> for GrabButtonRequest
sourcefn partial_cmp(&self, other: &GrabButtonRequest) -> Option<Ordering>
fn partial_cmp(&self, other: &GrabButtonRequest) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl Request for GrabButtonRequest
impl Request for GrabButtonRequest
impl Copy for GrabButtonRequest
impl Eq for GrabButtonRequest
impl StructuralEq for GrabButtonRequest
impl StructuralPartialEq for GrabButtonRequest
impl VoidRequest for GrabButtonRequest
Auto Trait Implementations
impl RefUnwindSafe for GrabButtonRequest
impl Send for GrabButtonRequest
impl Sync for GrabButtonRequest
impl Unpin for GrabButtonRequest
impl UnwindSafe for GrabButtonRequest
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more