Layout.LayoutManager: Cinnamon Javascript Reference Manual

## Layout.LayoutManager Layout.LayoutManager — Manager of Cinnamon Chrome |

## Functions

| updateChrome ()
| addChrome ()
| trackChrome ()
| untrackChrome ()
| removeChrome ()
Layout.Monitor | findMonitorForActor ()
number | findMonitorIndexForActor ()
boolean | isTrackingChrome ()

## Object Hierarchy

        Object
        ╰── Layout.LayoutManager

## Description

Creates and manages the Chrome container which holds all of the Cinnamon UI actors.

## Functions

### updateChrome ()

    updateChrome (boolean   doVisibility);

Updates input region and struts for all chrome actors. If `doVisibility` is true, then the visibility state of all chrome actors is recalculated first.

Use with care as this is already frequently updated, and can reduce performance if called unnecessarily.

#### Parameters

doVisibility | (optional) whether to recalculate visibility. |

### addChrome ()

    addChrome (Clutter.Actor   actor,
               object          params);

Adds `actor` to the chrome, and (unless `affectsInputRegion` in `params` is `false`) extends the input region to include it. Changes in `actor`'s size, position, and visibility will automatically result in appropriate changes to the input region.

If `affectsStruts` in `params` is `true` (and `actor` is along a screen edge), then `actor`'s size and position will also affect the window manager struts. Changes to `actor`'s visibility will NOT affect whether or not the strut is present, however.

If `visibleInFullscreen` in `params` is `true`, the actor will be visible even when a fullscreen window should be covering it.

#### Parameters

actor | an actor to add to the chrome |
params | (optional) additional params visibleInFullcreen (boolean): The actor should be hidden when a window on the same monitor is fullscreen. Default `false`. affectsStruts (boolean): The actor's allocation should be used to add window manager struts. Default `false`. affectsInputRegion (boolean): The actor should be added to the stage input region. Default `true`. addToWindowgroup (boolean): The actor should be added as a top-level window. Default `false`. doNotAdd (boolean): The actor should not be added to the uiGroup. This has no effect if `addToWindowgroup` is `true`. Default `false`. |

### trackChrome ()

    trackChrome (Clutter.Actor   actor,
                 object          params);

Tells the chrome to track `actor`. This can be used to extend the struts or input region to cover specific children.

`params` can have any of the same values as in addChrome(), though some possibilities don't make sense (eg, trying to have a `visibleInFullscreen` child of a non-`visibleInFullscreen` parent).

#### Parameters

actor | a descendant of the chrome to begin tracking |
params | (optional) additional params - defaults to same as chrome ancestor visibleInFullcreen (boolean): The actor should be hidden when a window on the same monitor is fullscreen. affectsStruts (boolean): The actor's allocation should be used to add window manager struts. affectsInputRegion (boolean): The actor should be added to the stage input region. addToWindowgroup (boolean): The actor should be added as a top-level window. doNotAdd (boolean): The actor should not be added to the uiGroup. This has no effect if `addToWindowgroup` is `true`. |

### untrackChrome ()

    untrackChrome (Clutter.Actor   actor);

Undoes the effect of trackChrome()

#### Parameters

actor | an actor previously tracked via trackChrome() |

### removeChrome ()

    removeChrome (Clutter.Actor   actor);

Removes the actor from the chrome

#### Parameters

actor | a chrome actor |

### findMonitorForActor ()

    Layout.Monitor
    findMonitorForActor (Clutter.Actor   actor);

Finds the monitor the actor is currently located on. If the actor is not found the primary monitor is returned.

#### Parameters

actor | the actor to locate |

#### Returns

the monitor

### findMonitorIndexForActor ()

    number
    findMonitorIndexForActor (Clutter.Actor   actor);

Finds the index of the monitor the actor is currently located on. If the actor is not found the primary monitor index is returned.

#### Parameters

actor | the actor to locate |

#### Returns

the monitor index

### isTrackingChrome ()

    boolean
    isTrackingChrome (Clutter.Actor   actor);

Determines whether the actor is currently tracked or not.

#### Parameters

actor | the actor to check |

#### Returns

whether the actor is currently tracked