| Top |
| CinnamonBgList * | cinnamon_bg_list_new () |
| void | cinnamon_bg_list_save () |
| void | cinnamon_bg_list_save_pictures () |
| CinnamonBgMode | cinnamon_bg_list_get_mode () |
| void | cinnamon_bg_list_set_mode () |
| CinnamonBgItem * | cinnamon_bg_list_get_item_for_monitor () |
| GPtrArray * | cinnamon_bg_list_get_monitor_infos () |
| void | cinnamon_bg_list_set_single_uri () |
| gboolean | cinnamon_bg_list_has_slideshow () |
| void | config-changed | Run Last |
| void | monitors-changed | Run Last |
| void | picture-uri-changed | Run Last |
A GListModel over the picture-uri-list and background-mode keys of
org.cinnamon.desktop.background, holding exactly what should be presented:
one CinnamonBgItem per connected monitor in CINNAMON_BG_MODE_INDEPENDENT,
exactly one in mirror and spanned, and nothing until the layout has loaded.
There is no stored-versus-resolved split: the items are the configuration.
Read them, set properties on them, and call cinnamon_bg_list_save().
The model is rederived whenever either key or the layout moves, matching each monitor to a stored entry by connector, then by logical index, then by inheriting its nearest matched neighbour. Items are reused across rebuilds, so a reference a consumer holds stays live and notifies in place.
::config-changed says the configuration moved, ::picture-uri-changed says a rotating wallpaper advanced and nothing else did. A rebuild that changed nothing is silent.
The layout is shared process-wide, so a list built once it has already loaded arrives fully populated and emits nothing afterwards.
void
cinnamon_bg_list_save (CinnamonBgList *self);
Writes the model to picture-uri-list.
The model holds only what is on screen, so entries for monitors that are not currently connected are not written back. Unplugging a monitor does not lose its entry — the model is rebuilt from the key, which still holds it — but a save taken while it is disconnected prunes it.
void
cinnamon_bg_list_save_pictures (CinnamonBgList *self);
Writes back only the pictures the model is showing, leaving every other stored entry exactly as it was.
For a rotating wallpaper advancing, which moves a picture and nothing else.
Unlike cinnamon_bg_list_save(), this never changes which entries exist: one
the model cannot represent - a monitor that is not currently connected, or one
the mode does not present - is written back untouched, and one the model has
but the key does not is not added. Reshaping the key is what a deliberate edit
does, and a rotation is not one.
void cinnamon_bg_list_set_mode (CinnamonBgList *self,CinnamonBgMode mode);
Writes background-mode. The list reloads from the key and rebuilds the
model, which resizes it, so wait for “config-changed” rather
than reading back immediately.
CinnamonBgItem * cinnamon_bg_list_get_item_for_monitor (CinnamonBgList *self,guint monitor);
What one monitor should show. Mirror and spanned hold a single item, which every monitor shows; independent holds one per monitor, so this indexes straight into the model.
GPtrArray *
cinnamon_bg_list_get_monitor_infos (CinnamonBgList *self);
The connected monitors, ordered left-to-right then top-to-bottom.
The layout is built on first use and loads asynchronously, so this is empty until the window manager answers. Read it from “monitors-changed” rather than immediately.
void
cinnamon_bg_list_set_single_uri (const char *uri);
Replaces the entire configuration with one zoomed picture on every monitor.
The "set as wallpaper" path an external app reaches through the legacy
picture-uri key: it discards any per-monitor layout and resets the mode to
CINNAMON_BG_MODE_MIRROR.
Writes the keys and nothing else, so a caller that only ever sets a wallpaper needs no CinnamonBgList of its own.
gboolean
cinnamon_bg_list_has_slideshow (void);
Whether anything in the stored configuration asks for a rotating wallpaper.
Reads the keys rather than a model, so a caller deciding whether to start the slideshow daemon needs no CinnamonBgList of its own, and gets an answer before any monitor layout has loaded.
“mode” property“mode” CinnamonBgMode
How the background behaves, mirroring the background-mode GSettings
key. Setting it writes the key; the list then reloads and rebuilds the
model.
Owner: CinnamonBgList
Flags: Read / Write
Default value: CINNAMON_BG_MODE_MIRROR
“config-changed” signalvoid user_function (CinnamonBgList *self, gpointer user_data)
Emitted when the configuration moved: a placement, a color, a slideshow being switched on or pointed elsewhere, the mode, or the set of monitors.
Everything except a rotating wallpaper advancing, which is “picture-uri-changed”. A component that reacts to what the user configured wants this one and not that one, so a slideshow's own writes stop coming back to it as though they were edits.
Flags: Run Last
“monitors-changed” signalvoid user_function (CinnamonBgList *self, gpointer user_data)
Emitted when the monitor layout has been reloaded: the initial asynchronous load, a hotplug, or the window manager appearing on the bus. The layout object's own settled signal, forwarded, so a component connects to (and disconnects from) the list alone.
The list starts the layout loading on construction, so this arrives on its own without anything having to ask for it.
Flags: Run Last
“picture-uri-changed” signalvoid user_function (CinnamonBgList *self, gpointer user_data)
Emitted when the only thing that moved is which picture an item shows, which is what a slideshow tick does.
Flags: Run Last