MCPcopy
hub / github.com/paperwm/PaperWM / updateBackground

Method updateBackground

tiling.js:1662–1697  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1660 }
1661
1662 updateBackground() {
1663 if (!this.monitor) {
1664 return;
1665 }
1666
1667 let path = this.settings.get_string('background') || Settings.prefs.default_background;
1668 let useDefault = gsettings.get_boolean('use-default-background');
1669 if (!path && useDefault) {
1670 if (interfaceSettings.get_string("color-scheme") === "prefer-dark") {
1671 path = backgroundSettings.get_string("picture-uri-dark");
1672 } else {
1673 path = backgroundSettings.get_string("picture-uri");
1674 }
1675 }
1676
1677 // destroy old background
1678 this.metaBackground?.destroy();
1679 this.metaBackground = null;
1680
1681 this.metaBackground = new Background.Background({
1682 monitorIndex: this.monitor.index,
1683 layoutManager: Main.layoutManager,
1684 settings: backgroundSettings,
1685 file: Gio.File.new_for_commandline_arg(path),
1686 style: GDesktopEnums.BackgroundStyle.ZOOM,
1687 });
1688
1689 this.background.content.set({
1690 background: this.metaBackground,
1691 });
1692
1693 // after creating new background apply this space's color
1694 if (this.color) {
1695 this.metaBackground.set_color(Utils.color_from_string(this.color)[1]);
1696 }
1697 }
1698
1699 updateName() {
1700 let name = workspaceSettings.getWorkspaceName(this.settings, this.index);

Callers 2

setSettingsMethod · 0.95
setMonitorMethod · 0.95

Calls 1

destroyMethod · 0.45

Tested by

no test coverage detected