Go to index / Go to protocols

cosmic_workspace_unstable_v1 ↗

cosmic_workspace_unstable_v1
zcosmic_workspace_manager_v1

Version 2

list and control workspaces

Workspaces, also called virtual desktops, are groups of surfaces. A compositor with a concept of workspaces may only show some such groups of surfaces (those of 'active' workspaces) at a time. 'Activating' a workspace is a request for the compositor to display that workspace's surfaces as normal, whereas the compositor may hide or otherwise de-emphasise surfaces that are associated only with 'inactive' workspaces. Workspaces are grouped by which sets of outputs they correspond to, and may contain surfaces only from those outputs. In this way, it is possible for each output to have its own set of workspaces, or for all outputs (or any other arbitrary grouping) to share workspaces. Compositors may optionally conceptually arrange each group of workspaces in an N-dimensional grid.

The purpose of this protocol is to enable the creation of taskbars and docks by providing them with a list of workspaces and their properties, and allowing them to activate and deactivate workspaces.

After a client binds the zcosmic_workspace_manager_v1, each workspace will be sent via the workspace event.

zcosmic_workspace_manager_v1
event workspace_group(
    workspace_group: new_id<zcosmic_workspace_group_handle_v1>,
)

    a workspace group has been created

    This event is emitted whenever a new workspace group has been created.

    All initial details of the workspace group (workspaces, outputs) will be sent immediately after this event via the corresponding events in zcosmic_workspace_group_handle_v1.

    zcosmic_workspace_manager_v1
    request commit()

      all requests about the workspaces have been sent

      The client must send this request after it has finished sending other requests. The compositor must process a series of requests preceding a commit request atomically.

      This allows changes to the workspace properties to be seen as atomic, even if they happen via multiple events, and even if they involve multiple zcosmic_workspace_handle_v1 objects, for example, deactivating one workspace and activating another.

      zcosmic_workspace_manager_v1
      event done()

        all information about the workspace groups has been sent

        This event is sent after all changes in all workspace groups have been sent.

        This allows changes to one or more zcosmic_workspace_group_handle_v1 properties and zcosmic_workspace_handle_v1 properties to be seen as atomic, even if they happen via multiple events. In particular, an output moving from one workspace group to another sends an output_enter event and an output_leave event to the two zcosmic_workspace_group_handle_v1 objects in question. The compositor sends the done event only after updating the output information in both workspace groups.

        zcosmic_workspace_manager_v1
        event finished()

          the compositor has finished with the workspace_manager

          This event indicates that the compositor is done sending events to the zcosmic_workspace_manager_v1. The server will destroy the object immediately after sending this request, so it will become invalid and the client should free any resources associated with it.

          zcosmic_workspace_manager_v1
          request stop()

            stop sending events

            Indicates the client no longer wishes to receive events for new workspace groups. However the compositor may emit further workspace events, until the finished event is emitted.

            The client must not send any more requests after this one.

            cosmic_workspace_unstable_v1
            zcosmic_workspace_group_handle_v1

            Version 2

            a workspace group assigned to a set of outputs

            A zcosmic_workspace_group_handle_v1 object represents a a workspace group that is assigned a set of outputs and contains a number of workspaces.

            The set of outputs assigned to the workspace group is conveyed to the client via output_enter and output_leave events, and its workspaces are conveyed with workspace events.

            For example, a compositor which has a set of workspaces for each output may advertise a workspace group (and its workspaces) per output, whereas a compositor where a workspace spans all outputs may advertise a single workspace group for all outputs.

            zcosmic_workspace_group_handle_v1
            enum zcosmic_workspace_group_capabilities_v1 {
                create_workspace = 1,
            }
            • create_workspace — create_workspace request is available
            zcosmic_workspace_group_handle_v1
            event capabilities(
                capabilities: array,
            )
            • capabilities — array of 32-bit capabilities

            compositor capabilities

            This event advertises the capabilities supported by the compositor. If a capability isn't supported, clients should hide or disable the UI elements that expose this functionality. For instance, if the compositor doesn't advertise support for creating workspaces, a button triggering the create_workspace request should not be displayed.

            The compositor will ignore requests it doesn't support. For instance, a compositor which doesn't advertise support for creating workspaces will ignore create_workspace requests.

            Compositors must send this event once after creation of an zcosmic_workspace_group_handle_v1 . When the capabilities change, compositors must send this event again.

            The capabilities are sent as an array of 32-bit unsigned integers in native endianness.

            zcosmic_workspace_group_handle_v1
            event output_enter(
                output: object<wl_output>,
            )

              output assigned to workspace group

              This event is emitted whenever an output is assigned to the workspace group.

              zcosmic_workspace_group_handle_v1
              event output_leave(
                  output: object<wl_output>,
              )

                output removed from workspace group

                This event is emitted whenever an output is removed from the workspace group.

                zcosmic_workspace_group_handle_v1
                event workspace(
                    workspace: new_id<zcosmic_workspace_handle_v1>,
                )

                  workspace added to workspace group

                  This event is emitted whenever a new workspace has been created. A workspace can only be a member of a single workspace group and cannot be re-assigned.

                  All initial details of the workspace (name, coordinates, state) will be sent immediately after this event via the corresponding events in zcosmic_workspace_handle_v1.

                  zcosmic_workspace_group_handle_v1
                  event remove()

                    this workspace group has been destroyed

                    This event means the zcosmic_workspace_group_handle_v1 has been destroyed. It is guaranteed there won't be any more events for this zcosmic_workspace_group_handle_v1. The zext_workspace_group_handle_v1 becomes inert so any requests will be ignored except the destroy request.

                    The compositor must remove all workspaces belonging to a workspace group before removing the workspace group.

                    zcosmic_workspace_group_handle_v1
                    request create_workspace(
                        workspace: string,
                    )

                      create a new workspace

                      Request that the compositor create a new workspace with the given name.

                      There is no guarantee that the compositor will create a new workspace, or that the created workspace will have the provided name.

                      zcosmic_workspace_group_handle_v1
                      request destroy()
                      Destructor

                        destroy the zcosmic_workspace_group_handle_v1 object

                        Destroys the zcosmic_workspace_group_handle_v1 object.

                        This request should be called either when the client does not want to use the workspace object any more or after the remove event to finalize the destruction of the object.

                        cosmic_workspace_unstable_v1
                        zcosmic_workspace_handle_v1

                        Version 2

                        a workspace handing a group of surfaces

                        A zcosmic_workspace_handle_v1 object represents a a workspace that handles a group of surfaces.

                        Each workspace has a name, conveyed to the client with the name event; a list of states, conveyed to the client with the state event; and optionally a set of coordinates, conveyed to the client with the coordinates event. The client may request that the compositor activate or deactivate the workspace.

                        Each workspace can belong to only a single workspace group. Depepending on the compositor policy, there might be workspaces with the same name in different workspace groups, but these workspaces are still separate (e.g. one of them might be active while the other is not).

                        zcosmic_workspace_handle_v1
                        event name(
                            name: string,
                        )

                          workspace name changed

                          This event is emitted immediately after the zcosmic_workspace_handle_v1 is created and whenever the name of the workspace changes.

                          zcosmic_workspace_handle_v1
                          event coordinates(
                              coordinates: array,
                          )

                            workspace coordinates changed

                            This event is used to organize workspaces into an N-dimensional grid within a workspace group, and if supported, is emitted immediately after the zcosmic_workspace_handle_v1 is created and whenever the coordinates of the workspace change. Compositors may not send this event if they do not conceptually arrange workspaces in this way. If compositors simply number workspaces, without any geometric interpretation, they may send 1D coordinates, which clients should not interpret as implying any geometry. Sending an empty array means that the compositor no longer orders the workspace geometrically.

                            Coordinates have an arbitrary number of dimensions N with an uint32 position along each dimension. By convention if N > 1, the first dimension is X, the second Y, the third Z, and so on. The compositor may chose to utilize these events for a more novel workspace layout convention, however. No guarantee is made about the grid being filled or bounded; there may be a workspace at coordinate 1 and another at coordinate 1000 and none in between. Within a workspace group, however, workspaces must have unique coordinates of equal dimensionality.

                            zcosmic_workspace_handle_v1
                            event state(
                                state: array,
                            )

                              the state of the workspace changed

                              This event is emitted immediately after the zcosmic_workspace_handle_v1 is created and each time the workspace state changes, either because of a compositor action or because of a request in this protocol.

                              zcosmic_workspace_handle_v1
                              enum state {
                                  active = 0,
                                  urgent = 1,
                                  hidden = 2,
                              }
                              • active — the workspace is active
                              • urgent — the workspace requests attention
                              • hidden

                                the workspace is not visible

                                The workspace is not visible in its workspace group, and clients attempting to visualize the compositor workspace state should not display such workspaces.

                              types of states on the workspace

                              The different states that a workspace can have.

                              zcosmic_workspace_handle_v1
                              enum zcosmic_workspace_capabilities_v1 {
                                  activate = 1,
                                  deactivate = 2,
                                  remove = 3,
                                  rename = 4,
                                  set_tiling_state = 5,
                              }
                              • activate — activate request is available
                              • deactivate — deactivate request is available
                              • remove — remove request is available
                              • rename — rename request is available
                                Available since version 2
                              • set_tiling_state — set_tiling_state request is available
                                Available since version 2
                              zcosmic_workspace_handle_v1
                              event capabilities(
                                  capabilities: array,
                              )
                              • capabilities — array of 32-bit capabilities

                              compositor capabilities

                              This event advertises the capabilities supported by the compositor. If a capability isn't supported, clients should hide or disable the UI elements that expose this functionality. For instance, if the compositor doesn't advertise support for removing workspaces, a button triggering the remove request should not be displayed.

                              The compositor will ignore requests it doesn't support. For instance, a compositor which doesn't advertise support for remove will ignore remove requests.

                              Compositors must send this event once after creation of an zcosmic_workspace_handle_v1 . When the capabilities change, compositors must send this event again.

                              The capabilities are sent as an array of 32-bit unsigned integers in native endianness.

                              zcosmic_workspace_handle_v1
                              event remove()

                                this workspace has been destroyed

                                This event means the zcosmic_workspace_handle_v1 has been destroyed. It is guaranteed there won't be any more events for this zcosmic_workspace_handle_v1. The zext_workspace_handle_v1 becomes inert so any requests will be ignored except the destroy request.

                                zcosmic_workspace_handle_v1
                                request destroy()
                                Destructor

                                  destroy the zcosmic_workspace_handle_v1 object

                                  Destroys the zcosmic_workspace_handle_v1 object.

                                  This request should be called either when the client does not want to use the workspace object any more or after the remove event to finalize the destruction of the object.

                                  zcosmic_workspace_handle_v1
                                  request activate()

                                    activate the workspace

                                    Request that this workspace be activated.

                                    There is no guarantee the workspace will be actually activated, and behaviour may be compositor-dependent. For example, activating a workspace may or may not deactivate all other workspaces in the same group.

                                    zcosmic_workspace_handle_v1
                                    request deactivate()

                                      activate the workspace

                                      Request that this workspace be deactivated.

                                      There is no guarantee the workspace will be actually deactivated.

                                      zcosmic_workspace_handle_v1
                                      request remove()

                                        remove the workspace

                                        Request that this workspace be removed.

                                        There is no guarantee the workspace will be actually removed.

                                        zcosmic_workspace_handle_v1
                                        event tiling_state(
                                            state: uint<tiling_state>,
                                        )
                                        Available since version 2

                                          indicates if tiling behavior is enabled for this workspace

                                          This event is emitted immediately after the zcosmic_workspace_handle_v1 is created and each time the workspace tiling state changes, either because of a compositor action or because of a request in this protocol.

                                          zcosmic_workspace_handle_v1
                                          enum tiling_state {
                                              floating_only = 0,
                                              tiling_enabled = 1,
                                          }
                                          Available since version 2
                                          • floating_only — The workspace has no active tiling properties
                                          • tiling_enabled — Tiling behavior is enabled for the workspace

                                          types of tiling state a workspace may have

                                          zcosmic_workspace_handle_v1
                                          request rename(
                                              name: string,
                                          )
                                          Available since version 2
                                          • name — new name of the workspace

                                          rename this workspace

                                          Request that this workspace is renamed.

                                          There is no guarantee the workspace will actually be renamed.

                                          zcosmic_workspace_handle_v1
                                          request set_tiling_state(
                                              state: uint<tiling_state>,
                                          )
                                          Available since version 2
                                          • state — the new tiling state of the workspace

                                          change the tiling state of this workspace

                                          Request that this workspace's tiling state is changed.

                                          There is no guarantee the workspace will actually change it's tiling state.