The xdg_positioner provides a collection of rules for the placement of a child surface relative to a parent surface. Rules can be defined to ensure the child surface remains within the visible area's borders, and to specify how the child surface changes its position, such as sliding along an axis, or flipping around a rectangle. These positioner-created rules are constrained by the requirement that a child surface must intersect with or be at least partially adjacent to its parent surface.
See the various requests for details about possible rules.
At the time of the request, the compositor makes a copy of the rules specified by the xdg_positioner. Thus, after the request is complete the xdg_positioner object can be destroyed or reused; further changes to the object will have no effect on previous usages.
For an xdg_positioner object to be considered complete, it must have a non-zero size set by set_size, and a non-zero anchor rectangle set by set_anchor_rect. Passing an incomplete xdg_positioner object when positioning a surface raises an invalid_positioner error.
◆ XDG_POSITIONER_DESTROY_SINCE_VERSION
#define XDG_POSITIONER_DESTROY_SINCE_VERSION 1 |
◆ XDG_POSITIONER_SET_ANCHOR_RECT_SINCE_VERSION
#define XDG_POSITIONER_SET_ANCHOR_RECT_SINCE_VERSION 1 |
◆ XDG_POSITIONER_SET_ANCHOR_SINCE_VERSION
#define XDG_POSITIONER_SET_ANCHOR_SINCE_VERSION 1 |
◆ XDG_POSITIONER_SET_CONSTRAINT_ADJUSTMENT_SINCE_VERSION
#define XDG_POSITIONER_SET_CONSTRAINT_ADJUSTMENT_SINCE_VERSION 1 |
◆ XDG_POSITIONER_SET_GRAVITY_SINCE_VERSION
#define XDG_POSITIONER_SET_GRAVITY_SINCE_VERSION 1 |
◆ XDG_POSITIONER_SET_OFFSET_SINCE_VERSION
#define XDG_POSITIONER_SET_OFFSET_SINCE_VERSION 1 |
◆ XDG_POSITIONER_SET_PARENT_CONFIGURE_SINCE_VERSION
#define XDG_POSITIONER_SET_PARENT_CONFIGURE_SINCE_VERSION 3 |
◆ XDG_POSITIONER_SET_PARENT_SIZE_SINCE_VERSION
#define XDG_POSITIONER_SET_PARENT_SIZE_SINCE_VERSION 3 |
◆ XDG_POSITIONER_SET_REACTIVE_SINCE_VERSION
#define XDG_POSITIONER_SET_REACTIVE_SINCE_VERSION 3 |
◆ XDG_POSITIONER_SET_SIZE_SINCE_VERSION
#define XDG_POSITIONER_SET_SIZE_SINCE_VERSION 1 |
◆ xdg_positioner_constraint_adjustment
constraint adjustments
The constraint adjustment value define ways the compositor will adjust the position of the surface, if the unadjusted position would result in the surface being partly constrained.
Whether a surface is considered 'constrained' is left to the compositor to determine. For example, the surface may be partly outside the compositor's defined 'work area', thus necessitating the child surface's position be adjusted until it is entirely inside the work area.
The adjustments can be combined, according to a defined precedence: 1) Flip, 2) Slide, 3) Resize.
Enumerator |
---|
XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_NONE | don't move the child surface when constrained
Don't alter the surface position even if it is constrained on some axis, for example partially outside the edge of an output.
|
XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_SLIDE_X | move along the x axis until unconstrained
Slide the surface along the x axis until it is no longer constrained.
First try to slide towards the direction of the gravity on the x axis until either the edge in the opposite direction of the gravity is unconstrained or the edge in the direction of the gravity is constrained.
Then try to slide towards the opposite direction of the gravity on the x axis until either the edge in the direction of the gravity is unconstrained or the edge in the opposite direction of the gravity is constrained.
|
XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_SLIDE_Y | move along the y axis until unconstrained
Slide the surface along the y axis until it is no longer constrained.
First try to slide towards the direction of the gravity on the y axis until either the edge in the opposite direction of the gravity is unconstrained or the edge in the direction of the gravity is constrained.
Then try to slide towards the opposite direction of the gravity on the y axis until either the edge in the direction of the gravity is unconstrained or the edge in the opposite direction of the gravity is constrained.
|
XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_FLIP_X | invert the anchor and gravity on the x axis
Invert the anchor and gravity on the x axis if the surface is constrained on the x axis. For example, if the left edge of the surface is constrained, the gravity is 'left' and the anchor is 'left', change the gravity to 'right' and the anchor to 'right'.
If the adjusted position also ends up being constrained, the resulting position of the flip_x adjustment will be the one before the adjustment.
|
XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_FLIP_Y | invert the anchor and gravity on the y axis
Invert the anchor and gravity on the y axis if the surface is constrained on the y axis. For example, if the bottom edge of the surface is constrained, the gravity is 'bottom' and the anchor is 'bottom', change the gravity to 'top' and the anchor to 'top'.
The adjusted position is calculated given the original anchor rectangle and offset, but with the new flipped anchor and gravity values.
If the adjusted position also ends up being constrained, the resulting position of the flip_y adjustment will be the one before the adjustment.
|
XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_RESIZE_X | horizontally resize the surface
Resize the surface horizontally so that it is completely unconstrained.
|
XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_RESIZE_Y | vertically resize the surface
Resize the surface vertically so that it is completely unconstrained.
|