Mutter Reference Manual: MetaScreen

## MetaScreen MetaScreen — Mutter X screen handler |

## Synopsis

                        MetaScreen;
                        MetaScreenClass;
    int                 meta_screen_get_screen_number       (MetaScreen *screen);
    MetaDisplay *       meta_screen_get_display             (MetaScreen *screen);
    Window              meta_screen_get_xroot               (MetaScreen *screen);
    void                meta_screen_get_size                (MetaScreen *screen,
                                                             int *width,
                                                             int *height);
    gpointer            meta_screen_get_compositor_data     (MetaScreen *screen);
    void                meta_screen_set_compositor_data     (MetaScreen *screen,
                                                             gpointer info);
    MetaScreen *        meta_screen_for_x_screen            (Screen *xscreen);
    void                meta_screen_set_cm_selection        (MetaScreen *screen);
    void                meta_screen_unset_cm_selection      (MetaScreen *screen);
    GSList *            meta_screen_get_startup_sequences   (MetaScreen *screen);
    GList *             meta_screen_get_workspaces          (MetaScreen *screen);
    int                 meta_screen_get_n_workspaces        (MetaScreen *screen);
    MetaWorkspace *     meta_screen_get_workspace_by_index  (MetaScreen *screen,
                                                             int index);
    void                meta_screen_remove_workspace        (MetaScreen *screen,
                                                             MetaWorkspace *workspace,
                                                             guint32 timestamp);
    MetaWorkspace *     meta_screen_append_new_workspace    (MetaScreen *screen,
                                                             gboolean activate,
                                                             guint32 timestamp);
    int                 meta_screen_get_active_workspace_index
                                                            (MetaScreen *screen);
    MetaWorkspace *     meta_screen_get_active_workspace    (MetaScreen *screen);
    int                 meta_screen_get_n_monitors          (MetaScreen *screen);
    int                 meta_screen_get_primary_monitor     (MetaScreen *screen);
    int                 meta_screen_get_current_monitor     (MetaScreen *screen);
    void                meta_screen_get_monitor_geometry    (MetaScreen *screen,
                                                             int monitor,
                                                             MetaRectangle *geometry);
    int                 meta_screen_get_monitor_index_for_rect
                                                            (MetaScreen *screen,
                                                             MetaRectangle *rect);
    void                meta_screen_focus_default_window    (MetaScreen *screen,
                                                             guint32 timestamp);
    enum                MetaScreenCorner;
    void                meta_screen_override_workspace_layout
                                                            (MetaScreen *screen,
                                                             MetaScreenCorner starting_corner,
                                                             gboolean vertical_layout,
                                                             int n_rows,
                                                             int n_columns);

## Object Hierarchy

      GObject
       +----MetaScreen

## Properties

      "keyboard-grabbed"         gboolean              : Read
      "n-workspaces"             gint                  : Read

## Signals

      "in-fullscreen-changed"                          : Run Last
      "monitors-changed"                               : Run Last
      "restacked"                                      : Run Last
      "startup-sequence-changed"                       : Run Last
      "window-entered-monitor"                         : Run Last
      "window-left-monitor"                            : Run Last
      "workareas-changed"                              : Run Last
      "workspace-added"                                : Run Last
      "workspace-removed"                              : Run Last
      "workspace-switched"                             : Run Last

## Description

## Details

### MetaScreen

    typedef struct _MetaScreen MetaScreen;

### MetaScreenClass

    typedef struct _MetaScreenClass MetaScreenClass;

### meta_screen_get_screen_number ()

    int                 meta_screen_get_screen_number       (MetaScreen *screen);

### meta_screen_get_display ()

    MetaDisplay *       meta_screen_get_display             (MetaScreen *screen);

Retrieve the display associated with screen.

`screen` : | A MetaScreen
Returns : | Display. [transfer none]

### meta_screen_get_xroot ()

    Window              meta_screen_get_xroot               (MetaScreen *screen);

`screen` : | A MetaScreen

### meta_screen_get_size ()

    void                meta_screen_get_size                (MetaScreen *screen,
                                                             int *width,
                                                             int *height);

Retrieve the size of the screen.

`screen` : | A MetaScreen
`width` : | The width of the screen. [out]
`height` : | The height of the screen. [out]

### meta_screen_get_compositor_data ()

    gpointer            meta_screen_get_compositor_data     (MetaScreen *screen);

`screen` : | A MetaScreen

### meta_screen_set_compositor_data ()

    void                meta_screen_set_compositor_data     (MetaScreen *screen,
                                                             gpointer info);

### meta_screen_for_x_screen ()

    MetaScreen *        meta_screen_for_x_screen            (Screen *xscreen);

Gets the MetaScreen corresponding to an X screen structure.

`xscreen` : | an X screen structure.
Returns : | the MetaScreen for the X screen `NULL` if Metacity is not managing the screen. [transfer none]

### meta_screen_set_cm_selection ()

    void                meta_screen_set_cm_selection        (MetaScreen *screen);

### meta_screen_unset_cm_selection ()

    void                meta_screen_unset_cm_selection      (MetaScreen *screen);

### meta_screen_get_startup_sequences ()

    GSList *            meta_screen_get_startup_sequences   (MetaScreen *screen);

Returns : | Currently active SnStartupSequence items. [transfer none]

### meta_screen_get_workspaces ()

    GList *             meta_screen_get_workspaces          (MetaScreen *screen);

`screen` : | a MetaScreen
Returns : | The workspaces for `screen`. [transfer none][element-type Meta.Workspace]

### meta_screen_get_n_workspaces ()

    int                 meta_screen_get_n_workspaces        (MetaScreen *screen);

### meta_screen_get_workspace_by_index ()

    MetaWorkspace *     meta_screen_get_workspace_by_index  (MetaScreen *screen,
                                                             int index);

Gets the workspace object for one of a screen's workspaces given the workspace index. It's valid to call this function with an out-of-range index and it will robustly return `NULL`.

`screen` : | a MetaScreen
`index` : | index of one of the screen's workspaces
Returns : | the workspace object with specified index, or `NULL` if the index is out of range. [transfer none]

### meta_screen_remove_workspace ()

    void                meta_screen_remove_workspace        (MetaScreen *screen,
                                                             MetaWorkspace *workspace,
                                                             guint32 timestamp);

### meta_screen_append_new_workspace ()

    MetaWorkspace *     meta_screen_append_new_workspace    (MetaScreen *screen,
                                                             gboolean activate,
                                                             guint32 timestamp);

Append a new workspace to the screen and (optionally) switch to that screen.

`screen` : | a MetaScreen
`activate` : | `TRUE` if the workspace should be switched to after creation
`timestamp` : | if switching to a new workspace, timestamp to be used when focusing a window on the new workspace. (Doesn't hurt to pass a valid timestamp when available even if not switching workspaces.)
Returns : | the newly appended workspace. [transfer none]

### meta_screen_get_active_workspace_index ()

    int                 meta_screen_get_active_workspace_index
                                                            (MetaScreen *screen);

### meta_screen_get_active_workspace ()

    MetaWorkspace *     meta_screen_get_active_workspace    (MetaScreen *screen);

`screen` : | A MetaScreen
Returns : | The current workspace. [transfer none]

### meta_screen_get_n_monitors ()

    int                 meta_screen_get_n_monitors          (MetaScreen *screen);

Gets the number of monitors that are joined together to form `screen`.

`screen` : | a MetaScreen
Returns : | the number of monitors

### meta_screen_get_primary_monitor ()

    int                 meta_screen_get_primary_monitor     (MetaScreen *screen);

Gets the index of the primary monitor on this `screen`.

`screen` : | a MetaScreen
Returns : | a monitor index

### meta_screen_get_current_monitor ()

    int                 meta_screen_get_current_monitor     (MetaScreen *screen);

Gets the index of the monitor that currently has the mouse pointer.

`screen` : | a MetaScreen
Returns : | a monitor index

### meta_screen_get_monitor_geometry ()

    void                meta_screen_get_monitor_geometry    (MetaScreen *screen,
                                                             int monitor,
                                                             MetaRectangle *geometry);

Stores the location and size of the indicated monitor in `geometry`.

`screen` : | a MetaScreen
`monitor` : | the monitor number
`geometry` : | location to store the monitor geometry. [out]

### meta_screen_get_monitor_index_for_rect ()

    int                 meta_screen_get_monitor_index_for_rect
                                                            (MetaScreen *screen,
                                                             MetaRectangle *rect);

### meta_screen_focus_default_window ()

    void                meta_screen_focus_default_window    (MetaScreen *screen,
                                                             guint32 timestamp);

### enum MetaScreenCorner

    typedef enum {
      META_SCREEN_TOPLEFT,
      META_SCREEN_TOPRIGHT,
      META_SCREEN_BOTTOMLEFT,
      META_SCREEN_BOTTOMRIGHT
    } MetaScreenCorner;

`META_SCREEN_TOPLEFT` | top-left corner
`META_SCREEN_TOPRIGHT` | top-right corner
`META_SCREEN_BOTTOMLEFT` | bottom-left corner
`META_SCREEN_BOTTOMRIGHT` | bottom-right corner

### meta_screen_override_workspace_layout ()

    void                meta_screen_override_workspace_layout
                                                            (MetaScreen *screen,
                                                             MetaScreenCorner starting_corner,
                                                             gboolean vertical_layout,
                                                             int n_rows,
                                                             int n_columns);

Explicitly set the layout of workspaces. Once this has been called, the contents of the _NET_DESKTOP_LAYOUT property on the root window are completely ignored.

`screen` : | a MetaScreen
`starting_corner` : | the corner at which the first workspace is found
`vertical_layout` : | if `TRUE` the workspaces are laid out in columns rather than rows
`n_rows` : | number of rows of workspaces, or -1 to determine the number of rows from `n_columns` and the total number of workspaces
`n_columns` : | number of columns of workspaces, or -1 to determine the number of columns from `n_rows` and the total number of workspaces

## Property Details

### The `"keyboard-grabbed"` property

      "keyboard-grabbed"         gboolean              : Read

Whether the keyboard is grabbed.

Default value: FALSE

### The `"n-workspaces"` property

      "n-workspaces"             gint                  : Read

Number of workspaces.

Allowed values: >= 1

Default value: 1

## Signal Details

### The `"in-fullscreen-changed"` signal

    void                user_function                      (MetaScreen *metascreen,
                                                            gpointer    user_data)       : Run Last

### The `"monitors-changed"` signal

    void                user_function                      (MetaScreen *metascreen,
                                                            gpointer    user_data)       : Run Last

### The `"restacked"` signal

    void                user_function                      (MetaScreen *metascreen,
                                                            gpointer    user_data)       : Run Last

### The `"startup-sequence-changed"` signal

    void                user_function                      (MetaScreen *metascreen,
                                                            gpointer    arg1,
                                                            gpointer    user_data)       : Run Last

### The `"window-entered-monitor"` signal

    void                user_function                      (MetaScreen *metascreen,
                                                            gint        arg1,
                                                            MetaWindow *arg2,
                                                            gpointer    user_data)       : Run Last

### The `"window-left-monitor"` signal

    void                user_function                      (MetaScreen *metascreen,
                                                            gint        arg1,
                                                            MetaWindow *arg2,
                                                            gpointer    user_data)       : Run Last

### The `"workareas-changed"` signal

    void                user_function                      (MetaScreen *metascreen,
                                                            gpointer    user_data)       : Run Last

### The `"workspace-added"` signal

    void                user_function                      (MetaScreen *metascreen,
                                                            gint        arg1,
                                                            gpointer    user_data)       : Run Last

### The `"workspace-removed"` signal

    void                user_function                      (MetaScreen *metascreen,
                                                            gint        arg1,
                                                            gpointer    user_data)       : Run Last

### The `"workspace-switched"` signal

    void                user_function                      (MetaScreen         *metascreen,
                                                            gint                arg1,
                                                            gint                arg2,
                                                            MetaMotionDirection arg3,
                                                            gpointer            user_data)       : Run Last