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

Version 38 #144

Merged
merged 23 commits into from Mar 19, 2022
Merged

Version 38 #144

merged 23 commits into from Mar 19, 2022

Conversation

neffo
Copy link
Owner

@neffo neffo commented Dec 18, 2021

Changes in this version:

@neffo neffo linked an issue Dec 19, 2021 that may be closed by this pull request
@neffo neffo linked an issue Dec 20, 2021 that may be closed by this pull request
@neffo neffo linked an issue Mar 6, 2022 that may be closed by this pull request
@bdaase
Copy link

bdaase commented Mar 14, 2022

I gave this a try on GNOME 42 (to see if it fixes #153), but this doesn't seem to work yet

Mär 14 20:03:20 p14s-gen2-amd gnome-shell[38824]: JS ERROR: TypeError: background is null
                                                   create_background_actor@/home/bjoern/.local/share/gnome-shell/extensions/blur-my-shell@aunetx/overview.js:101:9
                                                   update_backgrounds/<@/home/bjoern/.local/share/gnome-shell/extensions/blur-my-shell@aunetx/overview.js:92:35
                                                   update_backgrounds@/home/bjoern/.local/share/gnome-shell/extensions/blur-my-shell@aunetx/overview.js:91:37
                                                   enable/<@/home/bjoern/.local/share/gnome-shell/extensions/blur-my-shell@aunetx/overview.js:26:18
                                                   destroy@resource:///org/gnome/shell/ui/background.js:721:34
                                                   _updateBackgrounds@resource:///org/gnome/shell/ui/layout.js:499:33
                                                   _prepareStartupAnimation@resource:///org/gnome/shell/ui/layout.js:717:24
                                                   _loadBackground/signalId</id<@resource:///org/gnome/shell/ui/layout.js:655:22

@neffo
Copy link
Owner Author

neffo commented Mar 14, 2022

Thanks for testing Bjorn, but those errors seem to be generated by blur-my-shell? Is there a strange interaction occurring here that breaks wallpapers?

@bdaase
Copy link

bdaase commented Mar 14, 2022

Whoops, sorry, totally messed those up.

I also tested with blur-my-shell disabled now, but the problem persists, the background image isn't set :/

@neffo
Copy link
Owner Author

neffo commented Mar 14, 2022

All good, possibly related to the default image folder selection, GNOME 42 (or Glib) seems to do some things differently and I haven't properly tested the new code for handling it.

If you haven't changed anything the defaults may have produced something that doesn't work.

It should be '$HOME/Pictures/BingWallpaper' or equivalent for your locale, but this may get tripped up or may have carried over something from a previous install that has broken.

@bdaase
Copy link

bdaase commented Mar 15, 2022

All good, possibly related to the default image folder selection, GNOME 40 (or Glib) seems to do some things differently and I haven't properly tested the new code for handling it

Well, but it worked just fine with 41. So it must be something that changed from 41 to 42...

If you haven't changed anything the defaults may have produced something that doesn't work.

Yeah, didn't change anything there.

It should be '$HOME/Pictures/BingWallpaper' or equivalent for your locale, but this may get tripped up or may have carried over something from a previous install that has broken.

It is and the images get saved there just fine. But they don't get set as the background image.

@bdaase
Copy link

bdaase commented Mar 15, 2022

Alright, I think I know what's happening here now: The images are only set as the “Light” appearance wallpaper, but not as the “Dark” appearance one. That means, the extension currently works just fine if you have set the appearance style in gnome-control-center to “Light” but not when set to “Dark”.

@bdaase
Copy link

bdaase commented Mar 15, 2022

I gave it a shot now and this fixes it for me

diff --git a/extension.js b/extension.js
index aa20f00..eb14a01 100644
--- a/extension.js
+++ b/extension.js
@@ -55,11 +55,13 @@ function notifyError(msg) {
     Main.notifyError("BingWallpaper extension error", msg);
 }
 
-function doSetBackground(uri, schema) {
+function doSetBackground(uri, schema, set_dark) {
     let gsettings = new Gio.Settings({schema: schema});
     let prev = gsettings.get_string('picture-uri');
     uri = 'file://' + uri;
     gsettings.set_string('picture-uri', uri);
+    if (set_dark)
+        gsettings.set_string('picture-uri-dark', uri);
     Gio.Settings.sync();
     gsettings.apply();
     return (prev != uri); // return true if background uri has changed
@@ -257,11 +259,11 @@ class BingWallpaperIndicator extends PanelMenu.Button {
     }
 
     _setBackgroundDesktop() {
-        doSetBackground(this.filename, Utils.DESKTOP_SCHEMA);
+        doSetBackground(this.filename, Utils.DESKTOP_SCHEMA, true);
     }
     
     _setBackgroundScreensaver() {
-        doSetBackground(this.filename, Utils.LOCKSCREEN_SCHEMA);
+        doSetBackground(this.filename, Utils.LOCKSCREEN_SCHEMA, false);
     }
 
     _copyURLToClipboard() {

@neffo
Copy link
Owner Author

neffo commented Mar 15, 2022

Alright, I think I know what's happening here now: The images are only set as the “Light” appearance wallpaper, but not as the “Dark” appearance one. That means, the extension currently works just fine if you have set the appearance style in gnome-control-center to “Light” but when set to “Dark”.

Wasn't aware of this change, might not be exposed in Ubuntu 22.04 beta though (which I am using).

@bdaase
Copy link

bdaase commented Mar 15, 2022

Wasn't aware of this change, might not be exposed in Ubuntu 22.04 beta though (which I am using).

That might very well be the case, and then the schema key also might not exist in Ubuntu 22.04. The above patch must then probably be guarded in some way...

@neffo
Copy link
Owner Author

neffo commented Mar 15, 2022

Ok, implemented a quick fix for this in this branch. Shouldn't break if the key doesn't exist.

UPDATE: appears to correctly set wallpaper on GNOME OS nightly with both light and dark styles

@bdaase
Copy link

bdaase commented Mar 15, 2022

I can confirm, seems to works as expected.

@neffo neffo linked an issue Mar 19, 2022 that may be closed by this pull request
@neffo neffo merged commit fc03e48 into master Mar 19, 2022
@neffo neffo deleted the version-38 branch March 19, 2022 11:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants