Bug 511167 - Increase the thread priority between mouse down and mouse up (WINCE only). r=blassey

This commit is contained in:
Doug Turner 2009-08-19 09:23:30 -07:00
Родитель 42e58bf6d0
Коммит fe16decc3a
1 изменённых файлов: 22 добавлений и 0 удалений

Просмотреть файл

@ -154,6 +154,7 @@
#if defined(WINCE)
#include "nsWindowCE.h"
#define KILL_PRIORITY_ID 2444
#endif
#include "nsWindowGfx.h"
@ -3784,6 +3785,11 @@ PRBool nsWindow::ProcessMessage(UINT msg, WPARAM &wParam, LPARAM &lParam,
case WM_MOUSEMOVE:
{
#ifdef WINCE
// Reset the kill timer so that we can continue at this
// priority
SetTimer(mWnd, KILL_PRIORITY_ID, 2000 /* 2seconds */, NULL);
#endif
// Suppress dispatch of pending events
// when mouse moves are generated by widget
// creation instead of user input.
@ -3803,8 +3809,19 @@ PRBool nsWindow::ProcessMessage(UINT msg, WPARAM &wParam, LPARAM &lParam,
}
break;
case WM_TIMER:
#ifdef WINCE
SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_NORMAL);
KillTimer(mWnd, KILL_PRIORITY_ID);
#endif
break;
case WM_LBUTTONDOWN:
{
#ifdef WINCE
SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_ABOVE_NORMAL);
SetTimer(mWnd, KILL_PRIORITY_ID, 2000 /* 2 seconds */, NULL);
#endif
result = DispatchMouseEvent(NS_MOUSE_BUTTON_DOWN, wParam, lParam,
PR_FALSE, nsMouseEvent::eLeftButton);
DispatchPendingEvents();
@ -3816,6 +3833,11 @@ PRBool nsWindow::ProcessMessage(UINT msg, WPARAM &wParam, LPARAM &lParam,
result = DispatchMouseEvent(NS_MOUSE_BUTTON_UP, wParam, lParam,
PR_FALSE, nsMouseEvent::eLeftButton);
DispatchPendingEvents();
#ifdef WINCE
SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_NORMAL);
KillTimer(mWnd, KILL_PRIORITY_ID);
#endif
}
break;