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

for the MSG_InternalGetMessage() call is a WM_TIMER.
This commit is contained in:
Francis Beaudet 1999-08-15 16:58:03 +00:00 committed by Alexandre Julliard
parent 489cb8b758
commit 7ed1af3df3
5 changed files with 18 additions and 9 deletions

View file

@ -2589,6 +2589,7 @@ static INT MENU_TrackMenu( HMENU hmenu, UINT wFlags, INT x, INT y,
BOOL fRemove;
INT executedMenuId = 0;
MTRACKER mt;
BOOL enterIdleSent = FALSE;
mt.trackFlags = 0;
mt.hCurrentMenu = hmenu;
@ -2617,11 +2618,14 @@ static INT MENU_TrackMenu( HMENU hmenu, UINT wFlags, INT x, INT y,
* 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))
{

View file

@ -15,7 +15,7 @@ extern DWORD MSG_WineStartTicks; /* Ticks at Wine startup */
/* 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 );

View file

@ -928,7 +928,7 @@ INT DIALOG_DoDialogBox( HWND hwnd, HWND owner )
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))
{

View file

@ -1182,7 +1182,7 @@ static BOOL MSG_PeekMessage( LPMSG msg, HWND hwnd, DWORD first, DWORD last,
* '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 @@ BOOL MSG_InternalGetMessage( MSG *msg, HWND hwnd, HWND hwndOwner,
{
/* 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 );
}
}

View file

@ -2032,7 +2032,7 @@ static LONG NC_StartSizeMove( WND* wndPtr, WPARAM16 wParam,
{
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 @@ static void NC_DoSizeMove( HWND hwnd, WORD wParam )
{
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 @@ static void NC_TrackMinMaxBox95( HWND hwnd, WORD wParam )
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 @@ static void NC_TrackMinMaxBox( HWND hwnd, WORD wParam )
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 @@ NC_TrackCloseButton95 (HWND hwnd, WORD wParam)
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);