Skip to content

Commit db49392

Browse files
committed
Revert "feat: enhance desk entry handling for touch-triggered events"
This reverts commit d4d53b5.
1 parent d4d53b5 commit db49392

File tree

4 files changed

+10
-22
lines changed

4 files changed

+10
-22
lines changed

src/lib/platform/MSWindowsDesks.cpp

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -201,9 +201,9 @@ void MSWindowsDesks::disable()
201201
m_isOnScreen = m_isPrimary;
202202
}
203203

204-
void MSWindowsDesks::enter(bool touchTriggered)
204+
void MSWindowsDesks::enter()
205205
{
206-
sendMessage(DESKFLOW_MSG_ENTER, touchTriggered ? 1 : 0, 0);
206+
sendMessage(DESKFLOW_MSG_ENTER, 0, 0);
207207
}
208208

209209
void MSWindowsDesks::leave(HKL keyLayout)
@@ -685,7 +685,7 @@ void setCursorVisibility(bool visible)
685685
LOG_ERR("unable to set cursor visibility after %d attempts", attempts);
686686
}
687687

688-
void MSWindowsDesks::deskEnter(Desk *desk, bool touchTriggered)
688+
void MSWindowsDesks::deskEnter(Desk *desk)
689689
{
690690
registerTouchRawInput(desk->m_window, false);
691691

@@ -713,19 +713,11 @@ void MSWindowsDesks::deskEnter(Desk *desk, bool touchTriggered)
713713
SetWindowPos(desk->m_window, HWND_BOTTOM, 0, 0, 0, 0,
714714
SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE | SWP_HIDEWINDOW);
715715

716-
// Always restore the ShowCursor counter (deskLeave decremented it).
717716
setCursorVisibility(true);
718717

719-
if (touchTriggered) {
720-
// Touch-triggered enter: keep cursor invisible. SetCursor(NULL)
721-
// draws nothing; the cursor becomes visible naturally when the
722-
// user moves the mouse (apps set cursor shape via WM_SETCURSOR).
723-
SetCursor(NULL);
724-
} else {
725-
HCURSOR arrow = LoadCursor(NULL, IDC_ARROW);
726-
SetClassLongPtr(desk->m_window, GCLP_HCURSOR, reinterpret_cast<LONG_PTR>(arrow));
727-
SetCursor(arrow);
728-
}
718+
HCURSOR arrow = LoadCursor(NULL, IDC_ARROW);
719+
SetClassLongPtr(desk->m_window, GCLP_HCURSOR, reinterpret_cast<LONG_PTR>(arrow));
720+
SetCursor(arrow);
729721

730722
// restore the foreground window
731723
// XXX -- this raises the window to the top of the Z-order. we
@@ -1119,7 +1111,7 @@ void MSWindowsDesks::deskThread(void *vdesk)
11191111

11201112
case DESKFLOW_MSG_ENTER:
11211113
m_isOnScreen = true;
1122-
deskEnter(desk, msg.wParam != 0);
1114+
deskEnter(desk);
11231115
break;
11241116

11251117
case DESKFLOW_MSG_LEAVE:

src/lib/platform/MSWindowsDesks.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ class MSWindowsDesks
9696
/*!
9797
Prepares a desk for when the cursor enters it.
9898
*/
99-
void enter(bool touchTriggered = false);
99+
void enter();
100100

101101
//! Notify of leaving a desk
102102
/*!
@@ -229,7 +229,7 @@ class MSWindowsDesks
229229
void deskMouseMove(SInt32 x, SInt32 y) const;
230230
void deskFakeTouchClick(SInt32 x, SInt32 y) const;
231231
void deskMouseRelativeMove(SInt32 dx, SInt32 dy) const;
232-
void deskEnter(Desk *desk, bool touchTriggered = false);
232+
void deskEnter(Desk *desk);
233233
void deskLeave(Desk *desk, HKL keyLayout);
234234
void deskThread(void *vdesk);
235235

src/lib/platform/MSWindowsScreen.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -294,9 +294,7 @@ void MSWindowsScreen::disable()
294294

295295
void MSWindowsScreen::enter()
296296
{
297-
bool touchEnter = m_touchTriggeredEnter;
298-
m_touchTriggeredEnter = false;
299-
m_desks->enter(touchEnter);
297+
m_desks->enter();
300298
if (m_isPrimary) {
301299
// enable special key sequences on win95 family
302300
enableSpecialKeys(true);
@@ -994,7 +992,6 @@ bool MSWindowsScreen::onPreDispatch(HWND hwnd, UINT message, WPARAM wParam, LPAR
994992
SInt32 y = static_cast<SInt32>(lParam);
995993
if (m_isPrimary) {
996994
LOG((CLOG_INFO "hook: touch activating primary at %d,%d", x, y));
997-
m_touchTriggeredEnter = true;
998995
sendEvent(m_events->forIPrimaryScreen().touchActivatedPrimary(),
999996
MotionInfo::alloc(x, y));
1000997
} else {

src/lib/platform/MSWindowsScreen.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,6 @@ class MSWindowsScreen : public PlatformScreen
364364
MSWindowsPowerManager m_powerManager;
365365

366366
bool m_touchActivateScreen;
367-
bool m_touchTriggeredEnter = false;
368367

369368
Stopwatch m_touchDebounceTimer;
370369
static constexpr double kTouchDebounceTime = 0.15;

0 commit comments

Comments
 (0)