Closed hisnameisjimmy closed 4 years ago
I would first try reproducing with just plain Node.js, using the example in the readme: https://github.com/sindresorhus/wallpaper#usage If that doesn't reproduce the issue, the problem is with your code.
Maybe the image you set disappear from the path your set when changing window focus? And when it disappears, the system reverts to the previous image.
Quick response! I was actually just able to reproduce it from the CLI just running the following:
$ wallpaper https://ids.lib.harvard.edu/ids/iiif/18483392/full/full/0/default.jpg
I'm running this on Mojave after installing it globally via this:
$ npm install --global wallpaper-cli
I'm gonna try this on another machine just to make sure I don't have some weird environment thing going on. Will update!
Welp, like many issue reports, this one is ending up super embarassing. I had another program running that was managing the wallpaper that I completely forgot about. Once I killed it, everything worked and made sense. I spent way more time on this than I would like to admit.
Thank you for the quick response!
I'm building a little Electron app that runs in the tray and changes the wallpaper. While it does this reliably, the wallpaper changes back if any other window takes focus. Can't figure out why or how this could be happening. I would assume once the wallpaper is changed, that it wouldn't change back.
I have this function doing the heavy lifting in
main.js
:This gets called from the renderer, passing in whatever URL:
This all seems pretty straightforward. And, indeed, it reliably downloads the file and sets the wallpaper. However, as soon as I click on another window and it takes focus, the wallpaper switches back the what it was originally. I cannot find a single thing about this kind of behavior online and I can't really wrap my head around what is happening.
Is there anything obvious I'm missing?