mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Backing out bug 475361. untested code. r=ere+dougt
This commit is contained in:
parent
94ca5d4a92
commit
835b33c191
@ -43,33 +43,14 @@
|
||||
|
||||
NS_IMPL_ISUPPORTS1(nsIdleServiceWin, nsIIdleService)
|
||||
|
||||
|
||||
#ifdef WINCE
|
||||
// The last user input event time in microseconds. If there are any pending
|
||||
// native toolkit input events it returns the current time. The value is
|
||||
// compatible with PR_IntervalToMicroseconds(PR_IntervalNow()).
|
||||
// DEFINED IN widget/src/windows/nsWindow.cpp
|
||||
extern PRUint32 gLastInputEventTime;
|
||||
#endif
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsIdleServiceWin::GetIdleTime(PRUint32 *aTimeDiff)
|
||||
{
|
||||
#ifndef WINCE
|
||||
LASTINPUTINFO inputInfo;
|
||||
inputInfo.cbSize = sizeof(inputInfo);
|
||||
if (!::GetLastInputInfo(&inputInfo))
|
||||
return NS_ERROR_FAILURE;
|
||||
LASTINPUTINFO inputInfo;
|
||||
inputInfo.cbSize = sizeof(inputInfo);
|
||||
if (!::GetLastInputInfo(&inputInfo))
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
*aTimeDiff = SAFE_COMPARE_EVEN_WITH_WRAPPING(GetTickCount(), inputInfo.dwTime);
|
||||
#else
|
||||
// NOTE: nowTime is not necessarily equivalent to GetTickCount() return value
|
||||
// we need to compare apples to apples - hence the nowTime variable
|
||||
PRUint32 nowTime = PR_IntervalToMicroseconds(PR_IntervalNow());
|
||||
|
||||
*aTimeDiff = SAFE_COMPARE_EVEN_WITH_WRAPPING(nowTime, gLastInputEventTime);
|
||||
#endif
|
||||
|
||||
return NS_OK;
|
||||
*aTimeDiff = GetTickCount() - inputInfo.dwTime;
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -43,19 +43,11 @@
|
||||
|
||||
#include "nsIdleService.h"
|
||||
|
||||
|
||||
/* NOTE: Compare of GetTickCount() could overflow. This corrects for
|
||||
* overflow situations.
|
||||
***/
|
||||
#ifndef SAFE_COMPARE_EVEN_WITH_WRAPPING
|
||||
#define SAFE_COMPARE_EVEN_WITH_WRAPPING(A, B) (((int)((long)A - (long)B) & 0xFFFFFFFF))
|
||||
#endif
|
||||
|
||||
|
||||
class nsIdleServiceWin : public nsIdleService
|
||||
{
|
||||
public:
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
NS_IMETHOD GetIdleTime(PRUint32* idleTime);
|
||||
};
|
||||
|
||||
|
@ -453,10 +453,7 @@ static BYTE gLastMouseButton = 0;
|
||||
// The last user input event time in microseconds. If there are any pending
|
||||
// native toolkit input events it returns the current time. The value is
|
||||
// compatible with PR_IntervalToMicroseconds(PR_IntervalNow()).
|
||||
#ifdef WINCE
|
||||
static
|
||||
#endif
|
||||
PRUint32 gLastInputEventTime = 0;
|
||||
static PRUint32 gLastInputEventTime = 0;
|
||||
|
||||
static int gTrimOnMinimize = 2; // uninitialized, but still true
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user