Skip to content

feat: add virtual desktop notification support#56

Open
amnweb wants to merge 2 commits intomirober:masterfrom
amnweb:master
Open

feat: add virtual desktop notification support#56
amnweb wants to merge 2 commits intomirober:masterfrom
amnweb:master

Conversation

@amnweb
Copy link
Copy Markdown

@amnweb amnweb commented Mar 18, 2026

This adds support for IVirtualDesktopNotification the COM interface Windows uses to push desktop change events instead of polling.

Pyvda currently has no way to get notified when desktops change, you have to poll. Windows exposes IVirtualDesktopNotification for exactly this.

Example:

from pyvda import VirtualDesktopNotificationService

class MyHandler:
    def desktop_changed(self, *args):
        print("switched!")
    def desktop_created(self, *args):
        print("new desktop")

svc = VirtualDesktopNotificationService()
cookie = svc.register(MyHandler())
# ...
svc.unregister(cookie)

Build coverage notification GUIDs and vtable layouts are defined for:

Win10 (< 20231)
Win11 21H2 (20231–22620)
Win11 23H2 (22621–22630)
Win11 23H2 b3085+ / 24H2 (22631+)
Tested on build 26200.8037 (25H2).

amnweb added 2 commits March 18, 2026 01:12
…ktop 1

- When no fallback is provided, remove() now picks desktop 2 if removing desktop 1, avoiding passing the same desktop as both target and fallback.
- Fixes COM error (-2147024809) caused by RemoveDesktop receiving identical desktop and fallback parameters.
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

Successfully merging this pull request may close these issues.

1 participant