You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 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?
The text was updated successfully, but these errors were encountered:
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.
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.
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?
The text was updated successfully, but these errors were encountered: