AutoDarkMode / Windows-Auto-Night-Mode

Automatically switches between the dark and light theme of Windows 10 and Windows 11
GNU General Public License v3.0
7.61k stars 267 forks source link

Theme switching does not work with multiple desktops #469

Open ZhenmingYu opened 2 years ago

ZhenmingYu commented 2 years ago

Description

Theme switching does not work with multiple desktops.

For taskbar, start menu, and stuff, the app is working to automatically switch dark and light themes. However, for the wallpaper, the app switching does not work, only the first virtual desktops among many desktops get switched to the correct wallpaper.

Manual switching with shortcut keys still works and could switch the current desktop to the correct theme. However, the other desktops are still left behind with the old wallpaper from the other themes.

Expected Behavior

ADM should be able to switch all desktop wallpapers together.

I guess this could be done with a for-loop, where the AMD switches all desktops sequentially.

Log Data

service.log config.yaml.log

Operating System

Windows 11 pro 1000.22000.739.0

Commit Hash and Version

Screenshots

20220615172619
Spiritreader commented 2 years ago

duplicate of https://github.com/AutoDarkMode/Windows-Auto-Night-Mode/issues/228

However, you've filled out the bug report template and provided screenshots, so I'm closing the other issue in favor of this one.

There is a bit of weirdness when it comes to switching wallpapers on vdesktops. You can either do

OR

Not both, this is a windows limitation.

In addtion, this API is different in every. single. windows build., making this very cumbersome to develop. So for now, work on this is on hold until we figure something out.

For more info, you can check out this repo which actively tracks the new api https://github.com/MScholtes/VirtualDesktop

Also, in theory the wallpaper switch should work fine if you use our Wallpaper switching mechanism instead of Windows theme mode, but it may also be broken in newer builds.

ZhenmingYu commented 2 years ago

Thanks,

This should be labeled as a "known issue" to make it easier to follow.

Spiritreader commented 2 years ago

It actually was at some point, dunno what happened to it. I'll make this one the known issue

JasonHK commented 2 years ago

Also, in theory the wallpaper switch should work fine if you use our Wallpaper switching mechanism instead of Windows theme mode, but it may also be broken in newer builds.

@Spiritreader Nope, wallpaper switch mode is broken as well

JasonHK commented 2 years ago

Just an idea. Is it possible to detect virtual desktop switching? If possible, maybe we can check which wallpaper/theme was used, and switch to the correct one when switched between virtual desktop?

Spiritreader commented 2 years ago

Also, in theory the wallpaper switch should work fine if you use our Wallpaper switching mechanism instead of Windows theme mode, but it may also be broken in newer builds.

@Spiritreader Nope, wallpaper switch mode is broken as well

@Armin2208 could you re-test this when you get the chance? Thai contradicts our internal testing.

Armin2208 commented 2 years ago

Also, in theory the wallpaper switch should work fine if you use our Wallpaper switching mechanism instead of Windows theme mode, but it may also be broken in newer builds.

@Spiritreader Nope, wallpaper switch mode is broken as well

In which windows build are you facing issues with wallpaper switch?

Spiritreader commented 2 years ago

@JasonHK oh yes before I forget: did you use the multi monitor option when using our wallpaper switcher? It won't work with the other one. You have to use the multi monitor one as this should toggle a refresh of all vdesktop wallpapers.

JasonHK commented 2 years ago

Also, in theory the wallpaper switch should work fine if you use our Wallpaper switching mechanism instead of Windows theme mode, but it may also be broken in newer builds.

@Spiritreader Nope, wallpaper switch mode is broken as well

In which windows build are you facing issues with wallpaper switch?

@Armin2208 22000.856

@JasonHK oh yes before I forget: did you use the multi monitor option when using our wallpaper switcher? It won't work with the other one. You have to use the multi monitor one as this should toggle a refresh of all vdesktop wallpapers.

@Spiritreader That one doesn't work either

carlosvsilva commented 2 years ago

I have started to notice this major bug only after upgrade from Windows 11 21H2 to 22H2 latest Release Preview. Switching to Dark Theme is nearly instantaneous, but latest Windows Version 10.0.22621.382 forgets to change the wallpaper on all other virtual desktops, other than the current one in use.

I've reported the Windows bug (happens even when switching from Windows Settings) to Microsoft which breaks theming, and Auto Dark Mode, but the September 20th release date is fast approaching and the bug report remains unacknowledged (?). The only way to workaround this, is by going to every individual virtual desktop, open Windows Settings and click Personalization. Only then Windows changes the wallpaper to match the current theme.

If you want to help upvote the bug report, it's here:

https://aka.ms/AAhmoj9

Thanks!

AlbertoFabbri93 commented 2 years ago

When I try to open your link with the Feedback Hub I get the following error: "Your account doesn´t have access to this feedback."

carlosvsilva commented 2 years ago

I shared the feedback via the app "feedback hub" which produced that short URL, if it's forbidden, must be some problem on Microsoft side.

Spiritreader commented 2 years ago

The proper way to get ADM's own wallpaper switcher to work is this

If that doesn't work, then you're still not using the multi-monitor switching method that works with vdesktops. Try again starting with step 1.

Support for V-Desktops will come at some point, but there's still no package yet that provides this functionality with version-specific implementation. Until that is available, the method described above is the only way to get it working with our wallpaper switcher. The alternatives open to you are using the Windows theme mode, or not using the wallpaper switcher / using a third party wallpaper tool. They will start to work fine with ADM 10.3, which is already in beta and should be pretty stable as we're preparing to push it to stable.

HoeYeungHo commented 2 years ago

I am not sure whether the above operation can work. However, if I choose to switch themes automatically. I cannot pick a wallpaper with warnning: This feature is disabled while theme mode is enabled. I prefer that theme colors and wallpapers can be synchronized on multiple desktops.

ADM version:10.1.0.10 Windows version: Windows 11 22H2

Spiritreader commented 1 year ago

I am not sure whether the above operation can work. However, if I choose to switch themes automatically. I cannot pick a wallpaper with warnning: This feature is disabled while theme mode is enabled. I prefer that theme colors and wallpapers can be synchronized on multiple desktops.

ADM version:10.1.0.10 Windows version: Windows 11 22H2

Yes that is normal. You can either switch between two different themes, or let auto dark Mode modify one single theme.

If you use the theme mode, everything is managed by windows. If windows is buggy, then you'll have to live with it basically. You can manually create themes that use multi monitor wallpaper switching if you want. Check out Microsofts documentation on how to create theme files and that should do the trick.

ShunbaoLi commented 1 year ago

I am having the same issue.

But the situation on my side is a little bit different.

I found that the wallpaper will still switch automatically, but there will be a delay.

If you stay on the desktop whose wallpaper was not automatically switched for about a minute, the wallpaper will still auto-switch as expected.

github-actions[bot] commented 1 year ago

No updates have been provided to this issue after 60 days of inactivity. The issue will be automatically closed in 7 days.

Spiritreader commented 1 year ago

Not stale

ghost commented 1 year ago

@Spiritreader

Support for V-Desktops will come at some point, but there's still no package yet that provides this functionality with version-specific implementation.

There is, It is a Powershell module PSVirtualDesktop and it can set wallpaper on all virtual desktops like this:

Set-AllDesktopWallpapers -Path path

It has also a C# version with version-specific implementation: https://github.com/MScholtes/VirtualDesktop

AlesSrsen commented 1 year ago

Windows Auto Dark Mode - Change multi-screen wallpaper I've come across this article while searching for this issue, do you think this might be at least a temporary solution? Disclaimer, I haven't tried it since I want to use the switching of the whole theme. (But this might be useful also for that)

Spiritreader commented 1 year ago

Windows Auto Dark Mode - Change multi-screen wallpaper I've come across this article while searching for this issue, do you think this might be at least a temporary solution? Disclaimer, I haven't tried it since I want to use the switching of the whole theme. (But this might be useful also for that)

Hey! No this doesn't apply. The article itself is only half-correct information in the first place, since Auto Dark Mode does support multi screen wallpapers, just not the span argument. That needs to be set for single screen wallpapers (not multi screen!) and can be achieved by just setting it in Windows. ADM should not overwrite it in "Type: Picture" mode. So all of the functionality outlined in the article has always been part of the 10.X featureset.

Anyway, what I mentioned a while ago should work for multiple desktops though: https://github.com/AutoDarkMode/Windows-Auto-Night-Mode/issues/469#issuecomment-1289695690

Windows itself doesn't support multi-screen multi-vdesktop wallpapers itself. So the only way of making it work at least half-way now is by switching over to the multi-wallpaper switcher in Auto Dark Mode and then letting it do its thing: image

It is equivalent to enabling multi-monitor wallpapers in the windows settings.

The reason this only works when all virtual desktops have been closed prior to setting multi-monitor wallpapers is that Windows won't allow multi monitor wallpaper switching. If it detects virtual desktops open with different wallpapers present, the v-desktop wallpaper mode is considered active.

At the moment there are two possibilites:

ThioJoe commented 9 months ago

@Spiritreader

Support for V-Desktops will come at some point, but there's still no package yet that provides this functionality with version-specific implementation.

There is, It is a Powershell module PSVirtualDesktop and it can set wallpaper on all virtual desktops like this:

Set-AllDesktopWallpapers -Path path

It has also a C# version with version-specific implementation: https://github.com/MScholtes/VirtualDesktop

I was able to get everything working with virtual desktops using that powershell module and using the custom scripts feature. I just enabled custom scripts and disabled the "Enable wallpaper switch" option so everything is controlled individually with the script, because in my case I only wanted certain virtual desktops to change their wallpaper.

Here's an example of my yaml:

Enabled: true
Component:
  Scripts:
  - Name: Set Wallpaper Light Mode
    Command: powershell
    ArgsLight:
      - -Command
      - "Import-Module VirtualDesktop; Set-DesktopWallpaper -Desktop 'WhateverDesktopName1' -Path 'C:\\WhateverPath\\LightWallpaper.jpg' -PassThru; Set-DesktopWallpaper -Desktop 'WhateverDesktopName2' -Path 'C:\\WhateverPath\\LightWallpaper.jpg' -PassThru"
    ArgsDark: []
    AllowedSources: [Any]

  - Name: Set Wallpaper Dark Mode
    Command: powershell
    ArgsLight: []
    ArgsDark:
      - -Command
      - "Import-Module VirtualDesktop; Set-DesktopWallpaper -Desktop 'WhateverDesktopName1' -Path 'C:\\WhateverPath\\DarkWallpaper.jpg' -PassThru; Set-DesktopWallpaper -Desktop 'WhateverDesktopName2' -Path 'C:\\WhateverPath\\DarkWallpaper.jpg' -PassThru"
    AllowedSources: [Any]

Where you'd replace your desktop names instead of WhateverDesktopName and the wallpaper paths. That one is an example for two virtual desktops, but you can add more by doing another semicolon and copying the same Set-DesktopWallpaper command a third time.

Note that right now the module has an issue with the latest Windows 11 builds so at the moment you need to use a special version of the script the person made as described here: https://github.com/MScholtes/PSVirtualDesktop/issues/37#issuecomment-1927273764

VapidLinus commented 8 months ago

Span mode does not work with dark-mode switching for me.

Is this the same issue as here, or should I report this separately? And just to be clear, I recorded a video of what it looks like:

https://github.com/AutoDarkMode/Windows-Auto-Night-Mode/assets/4418470/a0d72d4e-4a21-4427-97b2-8e8aaf09905f

Mirror: https://files.vapid.li/24/vuY5FsCVsw.mp4

These are my settings: AutoDarkModeApp_IOc9lO4VHy AutoDarkModeApp_7drDhl6fd9 ApplicationFrameHost_zk2db01hxj

Spiritreader commented 8 months ago

Span mode does not work with dark-mode switching for me.

* I am in light mode

* I switch to dark mode

* Dark mode activates like it should

* I switch to light mode

* Light mode works briefly

* The dark wallpaper activates even though I am in light mode

Is this the same issue as here, or should I report this separately? And just to be clear, I recorded a video of what it looks like: vuY5FsCVsw.mp4

Mirror: https://files.vapid.li/24/vuY5FsCVsw.mp4

These are my settings: AutoDarkModeApp_IOc9lO4VHy AutoDarkModeApp_7drDhl6fd9 ApplicationFrameHost_zk2db01hxj

That sounds like you aren't using the latest build. Check your settings and verify you're using the latest beta build (which is up to date with the master branch)

VapidLinus commented 8 months ago

@Spiritreader I switched to the beta branch, and it did indeed fix the problem. Thank you!

redactedscribe commented 6 months ago

This also appears to be the reason why I receive two desktop notifications (spaced apart by a few minutes) each time the light/dark mode toggles. Deleting all my virtual desktops looks to have stopped that bug.

Edit: Nope, it didn't solve the issue. Not sure why I get double notifications to toggle the theme...