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/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);