Ignore:
Timestamp:
May 16, 2003, 12:59:28 PM (22 years ago)
Author:
sandervl
Message:

Handle WM_(SYS)TIMER timer calls in DispatchMessageA/W

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/user32/oslibmsg.cpp

    r10012 r10104  
    1 /* $Id: oslibmsg.cpp,v 1.68 2003-04-11 14:22:05 sandervl Exp $ */
     1/* $Id: oslibmsg.cpp,v 1.69 2003-05-16 10:59:26 sandervl Exp $ */
    22/*
    33 * Window message translation functions for OS/2
     
    324324    {
    325325        filtermin = TranslateWinMsg(uMsgFilterMin, TRUE);
    326             filtermax = TranslateWinMsg(uMsgFilterMax, FALSE);
    327             if(filtermin > filtermax) {
    328                 ULONG tmp = filtermin;
    329                     filtermin = filtermax;
    330                     filtermax = filtermin;
    331             }
    332         do {
    333                 eaten = FALSE;
    334                 rc = WinGetMsg(teb->o.odin.hab, &os2msg, 0, filtermin, filtermax);
    335                 if (os2msg.msg == WM_TIMER)
    336                     eaten = TIMER_HandleTimer(&os2msg);
    337                 if (os2msg.msg == WM_QUIT && ((ULONG)os2msg.mp2 != 0) ) {
    338                     // Don't return FALSE when the window list sends us
    339                     // a WM_QUIT message, improper killing can lead to
    340                     // application crashes.
    341                     // In the WM_QUIT handler in pmwindow we send a WM_CLOSE
    342                     // in this case. When the app calls PostQuitMessage (mp2 == 0),
    343                     // then we handle it the normal way
    344                     rc = 1;
    345                 }
    346             }
    347         while (eaten);
     326        filtermax = TranslateWinMsg(uMsgFilterMax, FALSE);
     327        if(filtermin > filtermax) {
     328            ULONG tmp = filtermin;
     329            filtermin = filtermax;
     330            filtermax = filtermin;
     331        }
     332        rc = WinGetMsg(teb->o.odin.hab, &os2msg, 0, filtermin, filtermax);
     333        if (os2msg.msg == WM_QUIT && ((ULONG)os2msg.mp2 != 0) ) {
     334            // Don't return FALSE when the window list sends us
     335            // a WM_QUIT message, improper killing can lead to
     336            // application crashes.
     337            // In the WM_QUIT handler in pmwindow we send a WM_CLOSE
     338            // in this case. When the app calls PostQuitMessage (mp2 == 0),
     339            // then we handle it the normal way
     340            rc = 1;
     341        }
    348342    }
    349343    if(OS2ToWinMsgTranslate((PVOID)teb, &os2msg, pMsg, isUnicode, MSG_REMOVE) == FALSE) {
     
    483477            if(ulPMFilter) {
    484478                do {
    485                     eaten = FALSE;
    486 
    487479                    rc = WinPeekMsg(teb->o.odin.hab, &os2msg, hwndOS2, ulPMFilter, ulPMFilter,
    488480                                    (fRemove & PM_REMOVE_W) ? PM_REMOVE : PM_NOREMOVE);
     
    492484                       rc = 0;
    493485                    }
    494                     if (rc && (fRemove & PM_REMOVE_W) && os2msg.msg == WM_TIMER) {
    495                         eaten = TIMER_HandleTimer(&os2msg);
    496                     }
    497486                }
    498                 while (eaten && rc);
     487                while (rc);
    499488            }
    500489            if(rc) {
     
    504493    }
    505494    else {
    506         do {
    507             eaten = FALSE;
    508 
    509             rc = WinPeekMsg(teb->o.odin.hab, &os2msg, hwndOS2, 0, 0, (fRemove & PM_REMOVE_W) ? PM_REMOVE : PM_NOREMOVE);
    510 
    511             if (rc && (fRemove & PM_REMOVE_W) && os2msg.msg == WM_TIMER) {
    512                 eaten = TIMER_HandleTimer(&os2msg);
    513             }
    514         }
    515         while (eaten && rc);
     495        rc = WinPeekMsg(teb->o.odin.hab, &os2msg, hwndOS2, 0, 0, (fRemove & PM_REMOVE_W) ? PM_REMOVE : PM_NOREMOVE);
    516496    }
    517497    if(rc == FALSE) {
Note: See TracChangeset for help on using the changeset viewer.