Commit 7ed1af3d authored by Francis Beaudet's avatar Francis Beaudet Committed by Alexandre Julliard

Ensure that the WM_ENTERIDLE message is not sent if the wake-up event

for the MSG_InternalGetMessage() call is a WM_TIMER.
parent 489cb8b7
...@@ -2589,6 +2589,7 @@ static INT MENU_TrackMenu( HMENU hmenu, UINT wFlags, INT x, INT y, ...@@ -2589,6 +2589,7 @@ static INT MENU_TrackMenu( HMENU hmenu, UINT wFlags, INT x, INT y,
BOOL fRemove; BOOL fRemove;
INT executedMenuId = 0; INT executedMenuId = 0;
MTRACKER mt; MTRACKER mt;
BOOL enterIdleSent = FALSE;
mt.trackFlags = 0; mt.trackFlags = 0;
mt.hCurrentMenu = hmenu; mt.hCurrentMenu = hmenu;
...@@ -2617,11 +2618,14 @@ static INT MENU_TrackMenu( HMENU hmenu, UINT wFlags, INT x, INT y, ...@@ -2617,11 +2618,14 @@ static INT MENU_TrackMenu( HMENU hmenu, UINT wFlags, INT x, INT y,
* clear that menu loop is not over yet. */ * clear that menu loop is not over yet. */
if (!MSG_InternalGetMessage( &msg, msg.hwnd, mt.hOwnerWnd, if (!MSG_InternalGetMessage( &msg, msg.hwnd, mt.hOwnerWnd,
MSGF_MENU, PM_NOREMOVE, TRUE )) break; MSGF_MENU, PM_NOREMOVE, !enterIdleSent, &enterIdleSent )) break;
TranslateMessage( &msg ); TranslateMessage( &msg );
mt.pt = msg.pt; mt.pt = msg.pt;
if ( (msg.hwnd==menu->hWnd) || (msg.message!=WM_TIMER) )
enterIdleSent=FALSE;
fRemove = FALSE; fRemove = FALSE;
if ((msg.message >= WM_MOUSEFIRST) && (msg.message <= WM_MOUSELAST)) if ((msg.message >= WM_MOUSEFIRST) && (msg.message <= WM_MOUSELAST))
{ {
......
...@@ -15,7 +15,7 @@ extern DWORD MSG_WineStartTicks; /* Ticks at Wine startup */ ...@@ -15,7 +15,7 @@ extern DWORD MSG_WineStartTicks; /* Ticks at Wine startup */
/* message.c */ /* message.c */
extern BOOL MSG_InternalGetMessage( MSG *msg, HWND hwnd, extern BOOL MSG_InternalGetMessage( MSG *msg, HWND hwnd,
HWND hwndOwner, WPARAM code, HWND hwndOwner, WPARAM code,
WORD flags, BOOL sendIdle ); WORD flags, BOOL sendIdle, BOOL* idleSent );
/* timer.c */ /* timer.c */
extern BOOL TIMER_Init( void ); extern BOOL TIMER_Init( void );
......
...@@ -928,7 +928,7 @@ INT DIALOG_DoDialogBox( HWND hwnd, HWND owner ) ...@@ -928,7 +928,7 @@ INT DIALOG_DoDialogBox( HWND hwnd, HWND owner )
EnableWindow( owner, FALSE ); EnableWindow( owner, FALSE );
ShowWindow( hwnd, SW_SHOW ); ShowWindow( hwnd, SW_SHOW );
while (MSG_InternalGetMessage(&msg, hwnd, owner, MSGF_DIALOGBOX, 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)) if (!IsDialogMessageA( hwnd, &msg))
{ {
......
...@@ -1182,7 +1182,7 @@ static BOOL MSG_PeekMessage( LPMSG msg, HWND hwnd, DWORD first, DWORD last, ...@@ -1182,7 +1182,7 @@ static BOOL MSG_PeekMessage( LPMSG msg, HWND hwnd, DWORD first, DWORD last,
* 'code' is the message filter value (MSGF_??? codes). * 'code' is the message filter value (MSGF_??? codes).
*/ */
BOOL MSG_InternalGetMessage( MSG *msg, HWND hwnd, HWND hwndOwner, BOOL MSG_InternalGetMessage( MSG *msg, HWND hwnd, HWND hwndOwner,
WPARAM code, WORD flags, BOOL sendIdle ) WPARAM code, WORD flags, BOOL sendIdle, BOOL* idleSent )
{ {
for (;;) for (;;)
{ {
...@@ -1192,8 +1192,13 @@ BOOL MSG_InternalGetMessage( MSG *msg, HWND hwnd, HWND hwndOwner, ...@@ -1192,8 +1192,13 @@ BOOL MSG_InternalGetMessage( MSG *msg, HWND hwnd, HWND hwndOwner,
{ {
/* No message present -> send ENTERIDLE and wait */ /* No message present -> send ENTERIDLE and wait */
if (IsWindow(hwndOwner)) if (IsWindow(hwndOwner))
{
SendMessageA( hwndOwner, WM_ENTERIDLE, SendMessageA( hwndOwner, WM_ENTERIDLE,
code, (LPARAM)hwnd ); code, (LPARAM)hwnd );
if (idleSent!=NULL)
*idleSent=TRUE;
}
MSG_PeekMessage( msg, 0, 0, 0, flags, FALSE ); MSG_PeekMessage( msg, 0, 0, 0, flags, FALSE );
} }
} }
......
...@@ -2032,7 +2032,7 @@ static LONG NC_StartSizeMove( WND* wndPtr, WPARAM16 wParam, ...@@ -2032,7 +2032,7 @@ static LONG NC_StartSizeMove( WND* wndPtr, WPARAM16 wParam,
{ {
while(!hittest) 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) switch(msg.message)
{ {
case WM_MOUSEMOVE: case WM_MOUSEMOVE:
...@@ -2193,7 +2193,7 @@ static void NC_DoSizeMove( HWND hwnd, WORD wParam ) ...@@ -2193,7 +2193,7 @@ static void NC_DoSizeMove( HWND hwnd, WORD wParam )
{ {
int dx = 0, dy = 0; 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 */ /* Exit on button-up, Return, or Esc */
if ((msg.message == WM_LBUTTONUP) || if ((msg.message == WM_LBUTTONUP) ||
...@@ -2382,7 +2382,7 @@ static void NC_TrackMinMaxBox95( HWND hwnd, WORD wParam ) ...@@ -2382,7 +2382,7 @@ static void NC_TrackMinMaxBox95( HWND hwnd, WORD wParam )
do do
{ {
BOOL oldstate = pressed; 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 ); CONV_POINT32TO16( &msg.pt, &pt16 );
pressed = (NC_HandleNCHitTest( hwnd, pt16 ) == wParam); pressed = (NC_HandleNCHitTest( hwnd, pt16 ) == wParam);
...@@ -2432,7 +2432,7 @@ static void NC_TrackMinMaxBox( HWND hwnd, WORD wParam ) ...@@ -2432,7 +2432,7 @@ static void NC_TrackMinMaxBox( HWND hwnd, WORD wParam )
do do
{ {
BOOL oldstate = pressed; 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 ); CONV_POINT32TO16( &msg.pt, &pt16 );
pressed = (NC_HandleNCHitTest( hwnd, pt16 ) == wParam); pressed = (NC_HandleNCHitTest( hwnd, pt16 ) == wParam);
...@@ -2488,7 +2488,7 @@ NC_TrackCloseButton95 (HWND hwnd, WORD wParam) ...@@ -2488,7 +2488,7 @@ NC_TrackCloseButton95 (HWND hwnd, WORD wParam)
do do
{ {
BOOL oldstate = pressed; 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 ); CONV_POINT32TO16( &msg.pt, &pt16 );
pressed = (NC_HandleNCHitTest( hwnd, pt16 ) == wParam); pressed = (NC_HandleNCHitTest( hwnd, pt16 ) == wParam);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment