100
100
MSWindowsDesks::MSWindowsDesks (
101
101
bool isPrimary, bool noHooks,
102
102
const IScreenSaver* screensaver, IEventQueue* events,
103
- IJob* updateKeys, bool stopOnDeskSwitch) :
103
+ IJob* updateKeys, bool stopOnDeskSwitch, bool headlessMode ) :
104
104
m_isPrimary(isPrimary),
105
105
m_noHooks(noHooks),
106
106
m_isOnScreen(m_isPrimary),
@@ -117,7 +117,8 @@ MSWindowsDesks::MSWindowsDesks(
117
117
m_deskReady(&m_mutex, false ),
118
118
m_updateKeys(updateKeys),
119
119
m_events(events),
120
- m_stopOnDeskSwitch(stopOnDeskSwitch)
120
+ m_stopOnDeskSwitch(stopOnDeskSwitch),
121
+ m_headlessMode(headlessMode)
121
122
{
122
123
m_cursor = createBlankCursor ();
123
124
m_deskClass = createDeskWindowClass (m_isPrimary);
@@ -596,9 +597,11 @@ MSWindowsDesks::deskLeave(Desk* desk, HKL keyLayout)
596
597
// we aren't notified when the mouse leaves our window.
597
598
SetCapture (desk->m_window );
598
599
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
+ }
602
605
}
603
606
}
604
607
0 commit comments