Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Can't Update the wallpaper #63

Open
NghiaTranUIT opened this issue Nov 16, 2018 · 1 comment
Open

Bug: Can't Update the wallpaper #63

NghiaTranUIT opened this issue Nov 16, 2018 · 1 comment
Assignees

Comments

@NghiaTranUIT
Copy link
Owner

NghiaTranUIT commented Nov 16, 2018

Description

There is a notice that Artify is unable to update a wallpaper if the main screen is not active.

How to reproduce

  1. Get Feature photo
  2. While fetching the photo, we active different window screen.
  3. When it it's finished, there is no update.

Acceptance Criteria

  • Able to update the the wallpaper regardless of any active window.
@NghiaTranUIT NghiaTranUIT self-assigned this Nov 16, 2018
@NghiaTranUIT
Copy link
Owner Author

After devoting couple hours to investigate why Artify couldn't override the wallpapers for all spaces, it turns out that

NSScreen.screens.forEach {
if let url = NSWorkspace.shared.desktopImageURL(for: $0),
url.absoluteString != payload.1.absoluteString {
isApplied = true
try? NSWorkspace.shared.setDesktopImageURL(payload.1, for: $0, options: [:])
}
}

NSScreen.screens only returns the physical screens, not the number of "spaces".

Preliminary effort

From OS < 10.7, macOS stores wallpaper datasource in com.apple.desktop.plist. Otherwise, it stores in ~/Library/Application Support/Dock/desktoppicture.db

This approach is capable of overriding the specific wallpaper for all spaces, but it requires to relaunch the Dock (killall Dock), which I'm super discouraged.

Beside that, editing the desktoppicture.db directly could be potential risk when the database's structure changes. Consequently, it's corrupted.

Thus, I leave this bug here.

References

https://github.com/tech-otaku/macos-desktop
https://github.com/SeanHansell/Casper-Change-Desktop

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant