r=pedemont, sr=blizzard (platform specific) OS/2 only - Implement GetLastInputEventTime git-svn-id: svn://10.0.0.236/trunk@140338 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -140,6 +140,11 @@ extern "C" {
|
||||
ULONG Address);
|
||||
}
|
||||
|
||||
// The last user input event time in milliseconds. If there are any pending
|
||||
// native toolkit input events it returns the current time. The value is
|
||||
// compatible with PR_IntervalToMicroseconds(PR_IntervalNow()).
|
||||
static PRUint32 gLastInputEventTime = 0;
|
||||
|
||||
#ifdef DEBUG_FOCUS
|
||||
static int currentWindowIdentifier = 0;
|
||||
#endif
|
||||
@@ -3327,6 +3332,21 @@ NS_METHOD nsWindow::SetPreferredSize(PRInt32 aWidth, PRInt32 aHeight)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsWindow::GetLastInputEventTime(PRUint32& aTime)
|
||||
{
|
||||
ULONG ulStatus = WinQueryQueueStatus(HWND_DESKTOP);
|
||||
|
||||
// If there is pending input then return the current time.
|
||||
if (ulStatus && (QS_KEY | QS_MOUSE | QS_MOUSEBUTTON | QS_MOUSEMOVE)) {
|
||||
gLastInputEventTime = PR_IntervalToMicroseconds(PR_IntervalNow());
|
||||
}
|
||||
|
||||
aTime = gLastInputEventTime;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// OS2-specific routines to emulate Windows behaviors
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
@@ -137,6 +137,8 @@ class nsWindow : public nsBaseWidget,
|
||||
NS_IMETHOD DispatchEvent( struct nsGUIEvent *event, nsEventStatus &aStatus);
|
||||
NS_IMETHOD CaptureRollupEvents(nsIRollupListener * aListener, PRBool aDoCapture, PRBool aConsumeRollupEvent);
|
||||
|
||||
NS_IMETHOD GetLastInputEventTime(PRUint32& aTime);
|
||||
|
||||
// Widget appearance
|
||||
virtual nsIFontMetrics *GetFont();
|
||||
NS_IMETHOD SetFont( const nsFont &aFont);
|
||||
|
||||
Reference in New Issue
Block a user