100100MSWindowsDesks::MSWindowsDesks (
101101 bool isPrimary, bool noHooks,
102102 const IScreenSaver* screensaver, IEventQueue* events,
103- IJob* updateKeys, bool stopOnDeskSwitch) :
103+ IJob* updateKeys, bool stopOnDeskSwitch, bool headlessMode ) :
104104 m_isPrimary(isPrimary),
105105 m_noHooks(noHooks),
106106 m_isOnScreen(m_isPrimary),
@@ -117,7 +117,8 @@ MSWindowsDesks::MSWindowsDesks(
117117 m_deskReady(&m_mutex, false ),
118118 m_updateKeys(updateKeys),
119119 m_events(events),
120- m_stopOnDeskSwitch(stopOnDeskSwitch)
120+ m_stopOnDeskSwitch(stopOnDeskSwitch),
121+ m_headlessMode(headlessMode)
121122{
122123 m_cursor = createBlankCursor ();
123124 m_deskClass = createDeskWindowClass (m_isPrimary);
@@ -596,9 +597,11 @@ MSWindowsDesks::deskLeave(Desk* desk, HKL keyLayout)
596597 // we aren't notified when the mouse leaves our window.
597598 SetCapture (desk->m_window );
598599
599- // warp the mouse to the cursor center
600- LOG ((CLOG_DEBUG2 " warping cursor to center: %+d,%+d" , m_xCenter, m_yCenter));
601- deskMouseMove (m_xCenter, m_yCenter);
600+ if (!m_headlessMode) {
601+ // warp the mouse to the cursor center
602+ LOG ((CLOG_DEBUG2 " warping cursor to center: %+d,%+d" , m_xCenter, m_yCenter));
603+ deskMouseMove (m_xCenter, m_yCenter);
604+ }
602605 }
603606}
604607
0 commit comments