Skip to content

xdg_toplevel_drag_v1¤

wayland.xdg_toplevel_drag_v1 ¤

Object representing a toplevel move during a drag

Methods:

  • destroy

    Destroy an xdg_toplevel_drag_v1 object

  • attach

    Move a toplevel with the drag operation

error ¤

destroy ¤

destroy() -> None

Destroy an xdg_toplevel_drag_v1 object

Destroy this xdg_toplevel_drag_v1 object. This request must only be called after the underlying wl_data_source drag has ended, as indicated by the dnd_drop_performed or cancelled events. In any other case an ongoing_drag error is raised.

attach ¤

attach(toplevel: xdg_toplevel, x_offset: int, y_offset: int) -> None

Move a toplevel with the drag operation

Request that the window will be moved with the cursor during the drag operation. The offset is a hint to the compositor how the toplevel should be positioned relative to the cursor hotspot in surface local coordinates and relative to the geometry of the toplevel being attached. See xdg_surface.set_window_geometry. For example it might only be used when an unmapped window is attached. The attached window does not participate in the selection of the drag target.

If the toplevel is unmapped while it is attached, it is automatically detached from the drag. In this case this request has to be called again if the window should be attached after it is remapped.

This request can be called multiple times but issuing it while a toplevel with an active role is attached raises a toplevel_attached error.

Parameters:

  • x_offset ¤

    (int) –

    Dragged surface x offset

  • y_offset ¤

    (int) –

    Dragged surface y offset