Ignore:
Timestamp:
Dec 26, 1999, 6:30:20 PM (26 years ago)
Author:
cbratschi
Message:

non-client fixes, DefWndProc enhancements, several other bugs fixed

File:
1 edited

Legend:

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

    r2200 r2204  
    1 /* $Id: pmwindow.cpp,v 1.69 1999-12-24 18:39:10 sandervl Exp $ */
     1/* $Id: pmwindow.cpp,v 1.70 1999-12-26 17:30:16 cbratschi Exp $ */
    22/*
    33 * Win32 Window Managment Code for OS/2
     
    136136 Win32BaseWindow *win32wnd;
    137137 THDB            *thdb;
    138  APIRET           rc;
     138 APIRET           rc = 0;
    139139 MSG              winMsg, *pWinMsg;
    140140
     
    175175  if(msg == WIN32APP_POSTMSG && (ULONG)mp1 == WIN32PM_MAGIC) {
    176176        //win32 app user message
    177         return (MRESULT)win32wnd->PostMessage((POSTMSG_PACKET *)mp2);;
     177        return (MRESULT)win32wnd->PostMessage((POSTMSG_PACKET *)mp2);
    178178  }
    179179  switch( msg )
     
    203203    case WM_QUIT:
    204204        dprintf(("OS2: WM_QUIT %x", hwnd));
    205         if(win32wnd->MsgQuit()) {
    206                 goto RunDefWndProc;
    207         }
     205        win32wnd->MsgQuit();
    208206        break;
    209207
    210208    case WM_CLOSE:
    211209        dprintf(("OS2: WM_CLOSE %x", hwnd));
    212         if(win32wnd->MsgClose()) {
    213                 goto RunDefWndProc;
    214         }
     210        win32wnd->MsgClose();
    215211        break;
    216212
    217213    case WM_DESTROY:
    218214        dprintf(("OS2: WM_DESTROY %x", hwnd));
    219         if(win32wnd->MsgDestroy()) {
    220                 goto RunDefWndProc;
    221         }
     215        win32wnd->MsgDestroy();
    222216        break;
    223217
    224218    case WM_ENABLE:
    225219        dprintf(("OS2: WM_ENABLE %x", hwnd));
    226         if(win32wnd->MsgEnable(SHORT1FROMMP(mp1))) {
    227                 goto RunDefWndProc;
    228         }
     220        win32wnd->MsgEnable(SHORT1FROMMP(mp1));
    229221        break;
    230222
    231223    case WM_SHOW:
    232224        dprintf(("OS2: WM_SHOW %x %d", hwnd, mp1));
    233         if(win32wnd->MsgShow((ULONG)mp1)) {
    234                 goto RunDefWndProc;
    235         }
     225        win32wnd->MsgShow((ULONG)mp1);
    236226        break;
    237227
     
    322312        }
    323313
    324         if(win32wnd->MsgActivate(SHORT1FROMMP(mp1), fMinimized, Win32BaseWindow::OS2ToWin32Handle(hwndActivate))) {
    325                 goto RunDefWndProc;
    326         }
    327         break;
     314        win32wnd->MsgActivate(SHORT1FROMMP(mp1), fMinimized, Win32BaseWindow::OS2ToWin32Handle(hwndActivate));
     315        break;
     316    }
     317
     318    case WM_SIZE:
     319    {
     320        dprintf(("OS2: WM_SIZE (%d,%d) (%d,%d)", SHORT1FROMMP(mp2), SHORT2FROMMP(mp2), SHORT1FROMMP(mp1), SHORT2FROMMP(mp2)));
     321        break;
     322    }
     323
     324    case WM_MINMAXFRAME:
     325    {
     326        dprintf(("OS2: WM_MINMAXFRAME"));
     327        break;
     328    }
     329
     330    case WM_OWNERPOSCHANGE:
     331    {
     332        dprintf(("OS2: WM_OWNERPOSCHANGE"));
     333        goto RunDefWndProc;
     334    }
     335
     336    case WM_CALCVALIDRECTS:
     337    {
     338        dprintf(("OS2: WM_CALCVALIDRECTS"));
     339        goto RunDefWndProc;
    328340    }
    329341
     
    341353                HWND hwndFocusWin32 = Win32BaseWindow::OS2ToWin32Handle(hwndFocus);
    342354                recreateCaret (hwndFocusWin32);
    343                 rc = win32wnd->MsgSetFocus(hwndFocusWin32);
    344         }
    345         else    rc = win32wnd->MsgKillFocus(Win32BaseWindow::OS2ToWin32Handle(hwndFocus));
    346         if(rc) {
    347                 goto RunDefWndProc;
    348         }
     355                win32wnd->MsgSetFocus(hwndFocusWin32);
     356        }
     357        else win32wnd->MsgKillFocus(Win32BaseWindow::OS2ToWin32Handle(hwndFocus));
    349358        break;
    350359    }
     
    362371    case WM_BUTTON3UP:
    363372    case WM_BUTTON3DBLCLK:
    364         if(win32wnd->MsgButton(pWinMsg)) {
    365                 goto RunDefWndProc;
    366         }
     373        win32wnd->MsgButton(pWinMsg);
     374        rc = TRUE;
    367375        break;
    368376
     
    386394
    387395    case WM_CONTROL:
     396        goto RunDefWndProc;
     397
    388398    case WM_COMMAND:
    389399        dprintf(("OS2: WM_COMMAND %x %x %x", hwnd, mp1, mp2));
    390400        win32wnd->DispatchMsg(pWinMsg);
    391         //todo controls + accelerators
    392401        break;
    393402
    394403    case WM_SYSCOMMAND:
    395     {
    396         if(win32wnd->DispatchMsg(pWinMsg)) {
    397             goto RunDefWndProc;
    398         }
    399         break;
    400     }
     404        win32wnd->DispatchMsg(pWinMsg);
     405        break;
     406
    401407    case WM_CHAR:
    402     {
    403408        win32wnd->DispatchMsg(pWinMsg);
    404409        break;
    405     }
    406410
    407411    case WM_INITMENU:
     
    424428        dprintf(("OS2: WM_SETWINDOWPARAMS %x", hwnd));
    425429        if(wndParams->fsStatus & WPM_TEXT) {
    426             if(win32wnd->MsgSetText(wndParams->pszText, wndParams->cchText)) {
    427                     goto RunDefWndProc;
    428             }
     430            win32wnd->MsgSetText(wndParams->pszText, wndParams->cchText);
    429431        }
    430432        goto RunDefWndProc;
     
    458460
    459461    case WM_HITTEST:
    460         // Only send this message if the window is enabled
    461         if (WinIsWindowEnabled(hwnd))
    462         {
    463                 if(win32wnd->MsgHitTest(pWinMsg)) {
    464                     goto RunDefWndProc;
    465                 }
    466         }
    467         else    goto RunDefWndProc;
     462    {
     463      DWORD res;
     464
     465      // Only send this message if the window is enabled
     466      if (!WinIsWindowEnabled(hwnd))
     467        res = HT_ERROR;
     468      else if (win32wnd->getIgnoreHitTest())
     469        res = HT_NORMAL;
     470      else
     471      {
     472        dprintf(("USER32: WM_HITTEST %x (%d,%d)",hwnd,(*(POINTS *)&mp1).x,(*(POINTS *)&mp1).y));
     473
     474        //CB: WinWindowFromPoint: PM sends WM_HITTEST -> loop -> stack overflow
     475        win32wnd->setIgnoreHitTest(TRUE);
     476        res = win32wnd->MsgHitTest(pWinMsg);
     477        win32wnd->setIgnoreHitTest(FALSE);
     478      }
     479      RestoreOS2TIB();
     480      return (MRESULT)res;
     481    }
    468482
    469483    case WM_CONTEXTMENU:
     
    479493        dprintf(("OS2: WM_ERASEBACKGROUND %x", win32wnd->getWindowHandle()));
    480494        break;
    481     }
    482 
    483     case WM_SIZE:
    484     {
    485         dprintf(("OS2: WM_SIZE (%d,%d) (%d,%d)", SHORT1FROMMP(mp2), SHORT2FROMMP(mp2), SHORT1FROMMP(mp1), SHORT2FROMMP(mp2)));
    486         break;
    487     }
    488     case WM_MINMAXFRAME:
    489     {
    490         dprintf(("OS2: WM_MINMAXFRAME"));
    491         break;
    492     }
    493     case WM_OWNERPOSCHANGE:
    494     {
    495         dprintf(("OS2: WM_OWNERPOSCHANGE"));
    496         goto RunDefWndProc;
    497     }
    498 
    499     case WM_CALCVALIDRECTS:
    500     {
    501         dprintf(("OS2: WM_CALCVALIDRECTS"));
    502         goto RunDefWndProc;
    503495    }
    504496
     
    533525  }
    534526  RestoreOS2TIB();
    535   return (MRESULT)FALSE;
     527  return (MRESULT)rc;
    536528
    537529RunDefWndProc:
Note: See TracChangeset for help on using the changeset viewer.