Changeset 102484 in vbox
- Timestamp:
- Dec 5, 2023 5:17:34 PM (10 months ago)
- File:
-
- 1 edited
-
trunk/src/VBox/Devices/Input/UsbMouse.cpp (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Input/UsbMouse.cpp
r98103 r102484 70 70 /** @} */ 71 71 72 #define TOUCH_TIMER_MSEC 20 /* 50 Hz touch contact repeat timer. */ 73 72 74 73 75 /********************************************************************************************************************************* … … 227 229 /** Tablet coordinate shift factor for old and broken operating systems. */ 228 230 uint8_t u8CoordShift; 231 232 /** Contact repeat timer. */ 233 TMTIMERHANDLE hContactTimer; 229 234 230 235 /** … … 1992 1997 } 1993 1998 1999 bool fTouchActive = false; 2000 1994 2001 /* Mark still dirty existing contacts as cancelled, because a new set of contacts does not include them. */ 1995 2002 for (i = 0; i < RT_ELEMENTS(pThis->aCurrentContactState); i++) … … 2001 2008 pCurContact->status &= ~MT_CONTACT_S_DIRTY; 2002 2009 } 2010 if (pCurContact->flags & MT_CONTACT_F_IN_CONTACT) 2011 fTouchActive = true; 2003 2012 } 2004 2013 … … 2024 2033 /* Send a report if possible. */ 2025 2034 usbHidSendReport(pThis); 2035 2036 /* If there is an active contact, set up a timer. Windows requires that touch input 2037 * gets repeated as long as there's contact, otherwise the guest decides that there 2038 * is no contact anymore, even though it was never told that. 2039 */ 2040 if (fTouchActive) 2041 PDMUsbHlpTimerSetMillies(pThis->pUsbIns, pThis->hContactTimer, TOUCH_TIMER_MSEC); 2042 else 2043 PDMUsbHlpTimerStop(pThis->pUsbIns, pThis->hContactTimer); 2026 2044 2027 2045 RTCritSectLeave(&pThis->CritSect); … … 2715 2733 2716 2734 /** 2735 * @callback_method_impl{FNTMTIMERUSB} 2736 * 2737 * A touchscreen needs to repeatedly sent contact information as long 2738 * as the contact is maintained. 2739 */ 2740 static DECLCALLBACK(void) usbHidContactTimer(PPDMUSBINS pUsbIns, TMTIMERHANDLE hTimer, void *pvUser) 2741 { 2742 PUSBHID pThis = (PUSBHID)pvUser; 2743 2744 LogRel3(("usbHid: contact repeat timer\n")); 2745 usbHidSendReport(pThis); 2746 2747 PDMUsbHlpTimerSetMillies(pUsbIns, hTimer, TOUCH_TIMER_MSEC); 2748 } 2749 2750 2751 /** 2717 2752 * @interface_method_impl{PDMUSBREG,pfnDestruct} 2718 2753 */ … … 2735 2770 pThis->hEvtDoneQueue = NIL_RTSEMEVENT; 2736 2771 } 2772 2773 PDMUsbHlpTimerDestroy(pUsbIns, pThis->hContactTimer); 2737 2774 } 2738 2775 … … 2809 2846 if (RT_FAILURE(rc)) 2810 2847 return PDMUsbHlpVMSetError(pUsbIns, rc, RT_SRC_POS, N_("HID failed to query shift factor")); 2848 2849 /* 2850 * Create the touchscreen contact repeat timer. 2851 */ 2852 rc = PDMUsbHlpTimerCreate(pUsbIns, TMCLOCK_VIRTUAL, usbHidContactTimer, pThis, 2853 TMTIMER_FLAGS_DEFAULT_CRIT_SECT, 2854 "Touchscreen Contact", &pThis->hContactTimer); 2855 AssertRCReturn(rc, rc); 2811 2856 2812 2857 return VINF_SUCCESS;
Note:
See TracChangeset
for help on using the changeset viewer.

