Ensure that the WM_ENTERIDLE message is not sent if the wake-up event
for the MSG_InternalGetMessage() call is a WM_TIMER.
diff --git a/controls/menu.c b/controls/menu.c
index 9092a4f..4b2beb8 100644
--- a/controls/menu.c
+++ b/controls/menu.c
@@ -2589,6 +2589,7 @@
BOOL fRemove;
INT executedMenuId = 0;
MTRACKER mt;
+ BOOL enterIdleSent = FALSE;
mt.trackFlags = 0;
mt.hCurrentMenu = hmenu;
@@ -2617,11 +2618,14 @@
* clear that menu loop is not over yet. */
if (!MSG_InternalGetMessage( &msg, msg.hwnd, mt.hOwnerWnd,
- MSGF_MENU, PM_NOREMOVE, TRUE )) break;
+ MSGF_MENU, PM_NOREMOVE, !enterIdleSent, &enterIdleSent )) break;
TranslateMessage( &msg );
mt.pt = msg.pt;
+ if ( (msg.hwnd==menu->hWnd) || (msg.message!=WM_TIMER) )
+ enterIdleSent=FALSE;
+
fRemove = FALSE;
if ((msg.message >= WM_MOUSEFIRST) && (msg.message <= WM_MOUSELAST))
{
diff --git a/include/message.h b/include/message.h
index 85ed316..3e6e3ec 100644
--- a/include/message.h
+++ b/include/message.h
@@ -15,7 +15,7 @@
/* message.c */
extern BOOL MSG_InternalGetMessage( MSG *msg, HWND hwnd,
HWND hwndOwner, WPARAM code,
- WORD flags, BOOL sendIdle );
+ WORD flags, BOOL sendIdle, BOOL* idleSent );
/* timer.c */
extern BOOL TIMER_Init( void );
diff --git a/windows/dialog.c b/windows/dialog.c
index a5d422e..58f195b 100644
--- a/windows/dialog.c
+++ b/windows/dialog.c
@@ -928,7 +928,7 @@
EnableWindow( owner, FALSE );
ShowWindow( hwnd, SW_SHOW );
while (MSG_InternalGetMessage(&msg, hwnd, owner, MSGF_DIALOGBOX,
- PM_REMOVE, !(wndPtr->dwStyle & DS_NOIDLEMSG) ))
+ PM_REMOVE, !(wndPtr->dwStyle & DS_NOIDLEMSG), NULL ))
{
if (!IsDialogMessageA( hwnd, &msg))
{
diff --git a/windows/message.c b/windows/message.c
index facfc19..9ceb0b0 100644
--- a/windows/message.c
+++ b/windows/message.c
@@ -1182,7 +1182,7 @@
* 'code' is the message filter value (MSGF_??? codes).
*/
BOOL MSG_InternalGetMessage( MSG *msg, HWND hwnd, HWND hwndOwner,
- WPARAM code, WORD flags, BOOL sendIdle )
+ WPARAM code, WORD flags, BOOL sendIdle, BOOL* idleSent )
{
for (;;)
{
@@ -1192,8 +1192,13 @@
{
/* No message present -> send ENTERIDLE and wait */
if (IsWindow(hwndOwner))
+ {
SendMessageA( hwndOwner, WM_ENTERIDLE,
code, (LPARAM)hwnd );
+
+ if (idleSent!=NULL)
+ *idleSent=TRUE;
+ }
MSG_PeekMessage( msg, 0, 0, 0, flags, FALSE );
}
}
diff --git a/windows/nonclient.c b/windows/nonclient.c
index d7a2b95..2363857 100644
--- a/windows/nonclient.c
+++ b/windows/nonclient.c
@@ -2032,7 +2032,7 @@
{
while(!hittest)
{
- MSG_InternalGetMessage( &msg, 0, 0, MSGF_SIZE, PM_REMOVE, FALSE );
+ MSG_InternalGetMessage( &msg, 0, 0, MSGF_SIZE, PM_REMOVE, FALSE, NULL );
switch(msg.message)
{
case WM_MOUSEMOVE:
@@ -2193,7 +2193,7 @@
{
int dx = 0, dy = 0;
- MSG_InternalGetMessage( &msg, 0, 0, MSGF_SIZE, PM_REMOVE, FALSE );
+ MSG_InternalGetMessage( &msg, 0, 0, MSGF_SIZE, PM_REMOVE, FALSE, NULL );
/* Exit on button-up, Return, or Esc */
if ((msg.message == WM_LBUTTONUP) ||
@@ -2382,7 +2382,7 @@
do
{
BOOL oldstate = pressed;
- MSG_InternalGetMessage( &msg, 0, 0, 0, PM_REMOVE, FALSE );
+ MSG_InternalGetMessage( &msg, 0, 0, 0, PM_REMOVE, FALSE, NULL );
CONV_POINT32TO16( &msg.pt, &pt16 );
pressed = (NC_HandleNCHitTest( hwnd, pt16 ) == wParam);
@@ -2432,7 +2432,7 @@
do
{
BOOL oldstate = pressed;
- MSG_InternalGetMessage( &msg, 0, 0, 0, PM_REMOVE, FALSE );
+ MSG_InternalGetMessage( &msg, 0, 0, 0, PM_REMOVE, FALSE, NULL );
CONV_POINT32TO16( &msg.pt, &pt16 );
pressed = (NC_HandleNCHitTest( hwnd, pt16 ) == wParam);
@@ -2488,7 +2488,7 @@
do
{
BOOL oldstate = pressed;
- MSG_InternalGetMessage( &msg, 0, 0, 0, PM_REMOVE, FALSE );
+ MSG_InternalGetMessage( &msg, 0, 0, 0, PM_REMOVE, FALSE, NULL );
CONV_POINT32TO16( &msg.pt, &pt16 );
pressed = (NC_HandleNCHitTest( hwnd, pt16 ) == wParam);