Go to index / Go to protocols

mir_shell_unstable_v1 ↗

mir_shell_unstable_v1
mir_shell_v1

Version 1
Compositor Support
Version 1
mir 2.26

create surface archetypes that are recognised by the desktop

Clients can use this interface to assign an archetype to wl_surfaces.

An archetype is like a wl_surface role: a surface may have at most one archetype, but unlike a wl_surface role a client may assign a new archetype to a surface which already has one. This will remove the old archetype and apply the new one atomically.

The archetype of a wl_surface influences the window-management policies applied to it.

All archetype state is double-buffered; changing a surface archetype or updates to any archetype state are not applied until the wl_surface is committed.

Typically, archetype state will be used to augments xdg_toplevel state. If a client intends to use an archetype, it SHOULD assign the surface an initial archetype during the initial commit without a buffer attached (see xdg_surface).

Any events sent to an archetype object are latched to and extend the xdg_surface.configure event. Any such events should be treated as a part of an atomic set of configuration changes (including any xdg_toplevel events) with the xdg_surface.configure event committing the accumulated state and requiring a xdg_surface.ack_configure call, as normal.

Changing archetype follows a similar sequence to the initial xdg_surface commit. First, a new archetype must be committed. This must be the only state committed in the wl_surface.commit request. The compositor will respond with any changes to the surface state prompted by the change of archetype followed by an xdg_surface.configure event. The client must ack the configure event (as normal) and the subsequent wl_surface.commit will cause the new archetype to be fully applied.

There are some wl_surface roles that conflict with the archetypes described here. Attempting to set both an archetypes and such roles on a surface is a protocol error. In particular, wl_subsurface, wl_cursor or xdg_popup may not be combined with an archetype.

mir_shell_v1
request get_regular_surface(
    id: new_id<mir_regular_surface_v1>,
    surface: object<wl_surface>,
)

    assign the mir_regular_surface_v1 archetype

    Create a mir_regular_surface_v1 archetype for the given surface. This assigns the archetype of regular_surface to the wl_surface, or raises a protocol error if another archetype is already assigned and the transition is disallowed.

    The previous archetype's role object becomes inert; the client should destroy the previous archetype role object. Any further calls to the previous archetype role object are a protocol error.

    mir_shell_v1
    request get_floating_regular_surface(
        id: new_id<mir_floating_regular_surface_v1>,
        surface: object<wl_surface>,
    )

      assign the mir_floating_regular_surface_v1 archetype

      Create a mir_floating_regular_surface_v1 archetype for the given surface. This assigns the archetype of floating_regular to the wl_surface, or raises a protocol error if another archetype is already assigned and the transition is disallowed.

      The previous archetype's role object becomes inert; the client should destroy the previous archetype role object. Any further calls to the previous archetype role object are a protocol error.

      A floating regular surface is "always on top" of other application windows and will not be docked.

      mir_shell_v1
      request get_dialog_surface(
          id: new_id<mir_dialog_surface_v1>,
          surface: object<wl_surface>,
      )

        assign the mir_dialog_surface_v1 archetype

        Create a mir_dialog_surface_v1 archetype for the given surface. This assigns the archetype of dialog_surface to the wl_surface, or raises a protocol error if another archetype is already assigned and the transition is disallowed.

        The previous archetype's role object becomes inert; the client should destroy the previous archetype role object. Any further calls to the previous archetype role object are a protocol error.

        A dialog is usually used to communicate information that must be explicitly acknowledged or responded to (for example, to report an error), or to get specific information about something requested in a parent window (for example, a Print dialog) or from a shell function (for example, to confirm shutdown).

        A dialog should have a parent whenever relevant. It may, however, be parentless.

        If a dialog has a parent, it is modal to the parent and any satellites the parent has. This means: (1) A user should be able to move, resize, or hide an open dialog’s parent, but not close it or interact with its contents; and move, resize, or close the parent’s satellites if any, but not interact with their contents. (2) Whenever the parent is minimized or otherwise hidden, the dialog should be minimized or hidden too. (3) Any attempt to give input focus to the parent should focus the dialog instead. Therefore, the dialog and all of its ancestors should be presented as a single entity in any window switcher.

        Partly because of that last behavior, a window should only ever have one dialog child at a time. If an app tries to open a second dialog child, The compositor should close the previous one first.

        mir_shell_v1
        request get_satellite_surface(
            id: new_id<mir_satellite_surface_v1>,
            surface: object<wl_surface>,
            positioner: object<mir_positioner_v1>,
        )

          assign the mir_satellite_surface_v1 archetype

          Create a mir_satellite_surface_v1 archetype for the given surface. This assigns the archetype of satellite_surface to the wl_surface, or raises a protocol error if another archetype is already assigned and the transition is disallowed.

          The previous archetype's role object becomes inert; the client should destroy the previous archetype role object. Any further calls to the previous archetype role object are a protocol error.

          A satellite is an accessory to a regular, floating regular, or dialog window. It always has a parent window, and typically it provides easy access to functions in its parent: for example, a toolbox, formatting palette, or Find/Change window.

          To reduce clutter when a satellite’s parent is not being used, a satellite should be present on screen only when any of its parents is active (for example, when a dialog or another satellite of its parent has input focus). Otherwise, subject to a delay to allow reparenting, it should not be present — not merely invisible or minimized, and not closed, but not present until its parent becomes active again (or an active window becomes its parent).

          To avoid flicker from briefly-appearing dialogs, whenever a satellite’s parent has a child dialog, the satellite should remain present. But like the parent window itself, it should not receive input as long as the dialog is open.

          mir_shell_v1
          request create_positioner(
              id: new_id<mir_positioner_v1>,
          )

            create a positioner object

            Create a positioner object. A positioner object is used to position surfaces relative to some parent surface. See the interface description and xdg_surface.get_popup for details.

            mir_shell_v1
            enum error {
                archetype = 0,
            }
            • archetype — wl_surface has another archetype that prevents this assignment
            mir_shell_v1
            request destroy()
            Destructor

              destroy the mir_shell object

              This request indicates that the client will not use the mir_shell object any more. Objects that have been created through this instance are not affected.

              mir_shell_unstable_v1
              mir_regular_surface_v1

              Version 1

              Mir metadata interface

              An interface that may be implemented by a wl_surface, for surfaces that are designed to be rendered in a desktop-like environment.

              mir_regular_surface_v1
              request destroy()
              Destructor

                destroy the regular surface archetype

                This request destroys the mir surface archetype and disassociates it from the surface.

                mir_shell_unstable_v1
                mir_floating_regular_surface_v1

                Version 1

                Mir metadata interface

                An interface that may be implemented by a wl_surface, for surfaces that are designed to be rendered in a desktop-like environment.

                mir_floating_regular_surface_v1
                request destroy()
                Destructor

                  destroy the floating_regular surface archetype

                  This request destroys the mir surface archetype and disassociates it from the surface.

                  mir_shell_unstable_v1
                  mir_dialog_surface_v1

                  Version 1

                  Mir metadata interface

                  An interface that may be implemented by a wl_surface, for surfaces that are designed to be rendered in a desktop-like environment.

                  mir_dialog_surface_v1
                  request destroy()
                  Destructor

                    destroy the dialog_surface archetype

                    This request destroys the mir surface archetype and disassociates it from the surface.

                    mir_shell_unstable_v1
                    mir_satellite_surface_v1

                    Version 1

                    Mir metadata interface

                    An interface that may be implemented by a wl_surface, for surfaces that are designed to be rendered in a desktop-like environment.

                    mir_satellite_surface_v1
                    request reposition(
                        positioner: object<mir_positioner_v1>,
                        token: uint,
                    )
                    • token — reposition request token

                    recalculate the satellite's location

                    Reposition an already-mapped satellite. The satellite will be placed given the details in the passed mir_positioner object, and a mir_satellite_surface_v1.repositioned followed by wl_surface.configure will be emitted in response. Any parameters set by the previous positioner will be discarded.

                    The passed token will be sent in the corresponding xdg_satellite.repositioned event. The new satellite position will not take effect until the corresponding configure event is acknowledged by the client. See xdg_satellite.repositioned for details. The token itself is opaque, and has no other special meaning.

                    If multiple reposition requests are sent, the compositor may skip all but the last one.

                    If the satellite is repositioned in response to a configure event for its parent, the client should send an mir_positioner.set_parent_configure and possibly an mir_positioner.set_parent_size request to allow the compositor to properly constrain the satellite.

                    If the satellite is repositioned together with a parent that is being resized, but not in response to a configure event, the client should send an mir_positioner.set_parent_size request.

                    mir_satellite_surface_v1
                    event repositioned(
                        token: uint,
                    )
                    • token — reposition request token

                    signal the completion of a repositioned request

                    The repositioned event is sent as part of a satellite configuration sequence, together with mir_satellite_surface_v1.configure and lastly wl_surface.configure to notify the completion of a reposition request.

                    The repositioned event is to notify about the completion of a mir_satellite_surface_v1.reposition request. The token argument is the token passed in the xdg_satellite.reposition request.

                    Immediately after this event is emitted, mir_satellite_surface_v1.configure and wl_surface.configure will be sent with the updated size and position, as well as a new configure serial.

                    The client should optionally update the content of the satellite, but must acknowledge the new satellite configuration for the new position to take effect. See mir_satellite_surface_v1.ack_configure for details.

                    mir_satellite_surface_v1
                    request destroy()
                    Destructor

                      destroy the satellite_surface archetype

                      This request destroys the mir surface archetype and disassociates it from the surface.

                      mir_shell_unstable_v1
                      mir_positioner_v1

                      Version 1

                      child surface positioner

                      The mir_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 mir_positioner. Thus, after the request is complete the mir_positioner object can be destroyed or reused; further changes to the object will have no effect on previous usages.

                      For an mir_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 mir_positioner object when positioning a surface raises an invalid_positioner error.

                      mir_positioner_v1
                      enum error {
                          invalid_input = 0,
                      }
                      • invalid_input — invalid input provided
                      mir_positioner_v1
                      request destroy()
                      Destructor

                        destroy the mir_positioner object

                        Notify the compositor that the mir_positioner will no longer be used.

                        mir_positioner_v1
                        request set_size(
                            width: int,
                            height: int,
                        )
                        • width — width of positioned rectangle
                        • height — height of positioned rectangle

                        set the size of the to-be positioned rectangle

                        Set the size of the surface that is to be positioned with the positioner object. The size is in surface-local coordinates and corresponds to the window geometry. See xdg_surface.set_window_geometry.

                        If a zero or negative size is set the invalid_input error is raised.

                        mir_positioner_v1
                        request set_anchor_rect(
                            x: int,
                            y: int,
                            width: int,
                            height: int,
                        )
                        • x — x position of anchor rectangle
                        • y — y position of anchor rectangle
                        • width — width of anchor rectangle
                        • height — height of anchor rectangle

                        set the anchor rectangle within the parent surface

                        Specify the anchor rectangle within the parent surface that the child surface will be placed relative to. The rectangle is relative to the window geometry as defined by xdg_surface.set_window_geometry of the parent surface.

                        When the mir_positioner object is used to position a child surface, the anchor rectangle may not extend outside the window geometry of the positioned child's parent surface.

                        If a negative size is set the invalid_input error is raised.

                        mir_positioner_v1
                        enum anchor {
                            none = 0,
                            top = 1,
                            bottom = 2,
                            left = 3,
                            right = 4,
                            top_left = 5,
                            bottom_left = 6,
                            top_right = 7,
                            bottom_right = 8,
                        }
                          mir_positioner_v1
                          request set_anchor(
                              anchor: uint<anchor>,
                          )
                          • anchor — anchor

                          set anchor rectangle anchor

                          Defines the anchor point for the anchor rectangle. The specified anchor is used derive an anchor point that the child surface will be positioned relative to. If a corner anchor is set (e.g. 'top_left' or 'bottom_right'), the anchor point will be at the specified corner; otherwise, the derived anchor point will be centered on the specified edge, or in the center of the anchor rectangle if no edge is specified.

                          mir_positioner_v1
                          enum gravity {
                              none = 0,
                              top = 1,
                              bottom = 2,
                              left = 3,
                              right = 4,
                              top_left = 5,
                              bottom_left = 6,
                              top_right = 7,
                              bottom_right = 8,
                          }
                            mir_positioner_v1
                            request set_gravity(
                                gravity: uint<gravity>,
                            )
                            • gravity — gravity direction

                            set child surface gravity

                            Defines in what direction a surface should be positioned, relative to the anchor point of the parent surface. If a corner gravity is specified (e.g. 'bottom_right' or 'top_left'), then the child surface will be placed towards the specified gravity; otherwise, the child surface will be centered over the anchor point on any axis that had no gravity specified. If the gravity is not in the ‘gravity’ enum, an invalid_input error is raised.

                            mir_positioner_v1
                            enum constraint_adjustment {
                                none = 0,
                                slide_x = 1,
                                slide_y = 2,
                                flip_x = 4,
                                flip_y = 8,
                                resize_x = 16,
                                resize_y = 32,
                            }
                            This is a bitfield
                            • 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.

                            • 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.

                            • 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.

                            • 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'.

                              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_x adjustment will be the one before the 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.

                            • resize_x

                              horizontally resize the surface

                              Resize the surface horizontally so that it is completely unconstrained.

                            • resize_y

                              vertically resize the surface

                              Resize the surface vertically so that it is completely unconstrained.

                            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.

                            mir_positioner_v1
                            request set_constraint_adjustment(
                                constraint_adjustment: uint,
                            )
                            • constraint_adjustment — bit mask of constraint adjustments

                            set the adjustment to be done when constrained

                            Specify how the window should be positioned if the originally intended position caused the surface to be constrained, meaning at least partially outside positioning boundaries set by the compositor. The adjustment is set by constructing a bitmask describing the adjustment to be made when the surface is constrained on that axis.

                            If no bit for one axis is set, the compositor will assume that the child surface should not change its position on that axis when constrained.

                            If more than one bit for one axis is set, the order of how adjustments are applied is specified in the corresponding adjustment descriptions.

                            The default adjustment is none.

                            mir_positioner_v1
                            request set_offset(
                                x: int,
                                y: int,
                            )
                            • x — surface position x offset
                            • y — surface position y offset

                            set surface position offset

                            Specify the surface position offset relative to the position of the anchor on the anchor rectangle and the anchor on the surface. For example if the anchor of the anchor rectangle is at (x, y), the surface has the gravity bottom_right, and the offset is (ox, oy), the calculated surface position will be (x + ox, y + oy). The offset position of the surface is the one used for constraint testing. See set_constraint_adjustment.