[Spice-commits] vdagent/vdagent.cpp

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Jul 19 11:08:01 UTC 2018

 vdagent/vdagent.cpp |    5 +++++
 1 file changed, 5 insertions(+)

New commits:
commit 9264c7f367e44ce2d4e773add80b63e1777e3e0f
Author: Frediano Ziglio <fziglio at redhat.com>
Date:   Thu Jul 5 16:13:00 2018 +0100

    vdagent: Add a comment around WinSta0_DesktopSwitch event usage
    Multiple times while I was reading this code was not clear why the
    synchronization of this event was not done in the main event loop.
    Also document why we want to use it not relying just on
    WTSRegisterSessionNotification and WM_WTSSESSION_CHANGE.
    Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
    Acked-by: Christophe Fergeau <cfergeau at redhat.com>

diff --git a/vdagent/vdagent.cpp b/vdagent/vdagent.cpp
index e577679..be17ddc 100644
--- a/vdagent/vdagent.cpp
+++ b/vdagent/vdagent.cpp
@@ -232,6 +232,11 @@ VDAgent::~VDAgent()
 DWORD WINAPI VDAgent::event_thread_proc(LPVOID param)
     VDAgent *agent = static_cast<VDAgent *>(param);
+    // This event is monitored in a separate thread to avoid losing
+    // events as the event is signaled with PulseEvent to wake up all
+    // thread waiting for it.
+    // This event allows to detect desktop switches which do not
+    // change sessions like pressing Ctrl-Alt-Delete.
     HANDLE desktop_event = OpenEvent(SYNCHRONIZE, FALSE, L"WinSta0_DesktopSwitch");
     if (!desktop_event) {
         vd_printf("OpenEvent() failed: %lu", GetLastError());

More information about the Spice-commits mailing list