Changeset 5696


Ignore:
Timestamp:
May 11, 2001, 10:40:40 PM (24 years ago)
Author:
sandervl
Message:

fixes

Location:
trunk/src/user32
Files:
2 edited

Legend:

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

    r5694 r5696  
    1 /* $Id: pmwindow.cpp,v 1.127 2001-05-11 19:21:46 sandervl Exp $ */
     1/* $Id: pmwindow.cpp,v 1.128 2001-05-11 20:40:39 sandervl Exp $ */
    22/*
    33 * Win32 Window Managment Code for OS/2
     
    202202        //probably win32 app user message
    203203        if((ULONG)mp1 == WIN32MSG_MAGICA) {
    204             return (MRESULT)win32wnd->DispatchMsgA(pWinMsg);
     204            rc = (MRESULT)win32wnd->DispatchMsgA(pWinMsg);
    205205        }
    206206        else
    207207        if((ULONG)mp1 == WIN32MSG_MAGICW) {
    208             return (MRESULT)win32wnd->DispatchMsgW(pWinMsg);
    209         }
    210     }
    211     else
    212     if(msg == WIN32APP_SETFOCUSMSG) {
    213       //PM doesn't allow SetFocus calls during WM_SETFOCUS message processing;
    214       //must delay this function call
    215       //mp1 = win32 window handle
    216       //mp2 = activate flag
    217       dprintf(("USER32: Delayed SetFocus %x call!", mp1));
    218       teb->o.odin.hwndFocus = 0;
    219       WinFocusChange(HWND_DESKTOP, hwnd, mp2 ? FC_NOLOSEACTIVE : 0);
     208            rc = (MRESULT)win32wnd->DispatchMsgW(pWinMsg);
     209        }
     210        RestoreOS2TIB();
     211        return rc;
    220212    }
    221213
     
    234226        if(win32wnd->MsgCreate(hwnd) == FALSE)
    235227        {
    236             return (MRESULT)TRUE; //discontinue window creation
     228            rc = (MRESULT)TRUE; //discontinue window creation
     229            break;
    237230        }
    238231    createfail:
    239         return (MRESULT)FALSE;
     232        rc = (MRESULT)FALSE;
     233        break;
    240234    }
    241235
     
    262256    case WM_SHOW:
    263257        dprintf(("OS2: WM_SHOW %x %d", hwnd, mp1));
     258        win32wnd->MsgShow((ULONG)mp1);
    264259        break;
    265260
     
    435430            wndpars->cbCtlData = 0;
    436431            wndpars->cbPresParams = 0;
    437             return (MRESULT)TRUE;
     432            rc = (MRESULT)TRUE;
     433            break;
    438434        }
    439435        goto RunDefWndProc;
     
    460456    {
    461457        dprintf(("OS2: WM_ERASEBACKGROUND %x", win32wnd->getWindowHandle()));
    462         return (MRESULT)FALSE;
     458        rc = (MRESULT)FALSE;
     459        break;
    463460    }
    464461
    465462    case WM_CALCVALIDRECTS:
    466       dprintf(("OS2: WM_CALCVALIDRECTS %x", win32wnd->getWindowHandle()));
    467       return (MRESULT)(CVR_ALIGNLEFT | CVR_ALIGNTOP);
     463        dprintf(("OS2: WM_CALCVALIDRECTS %x", win32wnd->getWindowHandle()));
     464        rc = (MRESULT)(CVR_ALIGNLEFT | CVR_ALIGNTOP);
     465        break;
    468466
    469467    case WM_REALIZEPALETTE:
     
    501499        goto RunDefWndProc;
    502500    }
     501    RestoreOS2TIB();
    503502    return (MRESULT)rc;
    504503
     
    566565    }
    567566
     567    case WIN32APP_SETFOCUSMSG:
     568        //PM doesn't allow SetFocus calls during WM_SETFOCUS message processing;
     569        //must delay this function call
     570        //mp1 = win32 window handle
     571        //mp2 = activate flag
     572        dprintf(("USER32: Delayed SetFocus %x %x call!", teb->o.odin.hwndFocus, mp1));
     573        if(teb->o.odin.hwndFocus) {
     574            win32wnd = Win32BaseWindow::GetWindowFromHandle(teb->o.odin.hwndFocus);
     575            teb->o.odin.hwndFocus = 0;
     576            if(win32wnd) {
     577                 WinFocusChange(HWND_DESKTOP, win32wnd->getOS2FrameWindowHandle(), (mp2) ? FC_NOLOSEACTIVE : 0);
     578            }
     579            else DebugInt3();
     580        }
     581        break;
     582
    568583    case WM_PAINT:
    569584    {
     
    597612    {
    598613        dprintf(("PMFRAME:WM_ERASEBACKGROUND %x", win32wnd->getWindowHandle()));
     614        RestoreOS2TIB();
    599615        return (MRESULT)FALSE;
    600616    }
     
    695711        {
    696712           Win32BaseWindow *wndAfter = Win32BaseWindow::GetWindowFromOS2Handle(pswp->hwndInsertBehind);
     713           dprintf2(("SWP_ZORDER: %x %x", pswp->hwndInsertBehind, (wndAfter) ? wndAfter->getWindowHandle() : 0));
    697714           if(wndAfter) {
    698715                wp.hwndInsertAfter = wndAfter->getWindowHandle();
     
    733750            pswp->hwnd = hwnd;
    734751
     752            RestoreOS2TIB();
    735753            return (MRESULT)0xf;
    736754        }
     755        RestoreOS2TIB();
    737756        return (MRESULT)0;
    738757    }
     
    750769        if ((pswp->fl & (SWP_SIZE | SWP_MOVE | SWP_ZORDER)) == 0)
    751770        {
     771            if(pswp->fl & SWP_SHOW) {
     772                WinShowWindow(win32wnd->getOS2WindowHandle(), 1);
     773            }
     774            else
     775            if(pswp->fl & SWP_HIDE) {
     776                WinShowWindow(win32wnd->getOS2WindowHandle(), 0);
     777            }
    752778            if(pswp->fl & SWP_ACTIVATE)
    753779            {
     
    792818        {
    793819            Win32BaseWindow *wndAfter = Win32BaseWindow::GetWindowFromOS2Handle(pswp->hwndInsertBehind);
     820            dprintf2(("SWP_ZORDER: %x %x", pswp->hwndInsertBehind, (wndAfter) ? wndAfter->getWindowHandle() : 0));
    794821            if(wndAfter) {
    795822                 wp.hwndInsertAfter = wndAfter->getWindowHandle();
     
    801828            WinShowWindow(win32wnd->getOS2WindowHandle(), 1);
    802829        }
     830        else
     831        if(pswp->fl & SWP_HIDE) {
     832            WinShowWindow(win32wnd->getOS2WindowHandle(), 0);
     833        }
     834
    803835#ifndef USE_CALCVALIDRECT
    804836        if((pswp->fl & (SWP_MOVE | SWP_SIZE)))
     
    913945
    914946PosChangedEnd:
     947        RestoreOS2TIB();
    915948        return (MRESULT)FALSE;
    916949    }
     
    9991032            newRect->yBottom += newClientRect.yBottom;
    10001033        }
     1034        RestoreOS2TIB();
    10011035        return (MRESULT)res;
    10021036    }
    10031037#else
    10041038        dprintf(("PMWINDOW: WM_CALCVALIDRECTS %x", win32wnd->getWindowHandle()));
     1039        RestoreOS2TIB();
    10051040        return (MRESULT)(CVR_ALIGNLEFT | CVR_ALIGNTOP);
    10061041#endif
     
    10211056        dprintf(("PMFRAME:WM_QUERYFOCUSCHAIN %x fsCmd %x parent %x", win32wnd->getWindowHandle(), SHORT1FROMMP(mp1), mp2));
    10221057
    1023 //        RestoreOS2TIB();
    1024 //        rc = pfnFrameWndProc(hwnd, msg, mp1, mp2);
    1025 //        SetWin32TIB();
    1026 //        dprintf(("PMFRAME:WM_QUERYFOCUSCHAIN %x fsCmd %x parent %x returned %x", win32wnd->getWindowHandle(), SHORT1FROMMP(mp1), mp2, rc));
    1027 //        break;
    1028         goto RunDefFrameWndProc;
     1058        RestoreOS2TIB();
     1059        rc = pfnFrameWndProc(hwnd, msg, mp1, mp2);
     1060        SetWin32TIB();
     1061        dprintf(("PMFRAME:WM_QUERYFOCUSCHAIN %x fsCmd %x parent %x returned %x", win32wnd->getWindowHandle(), SHORT1FROMMP(mp1), mp2, rc));
     1062        break;
     1063//        goto RunDefFrameWndProc;
    10291064#endif
    10301065
     
    10641099          //SvL: Check if window is still valid
    10651100          win32wnd = Win32BaseWindow::GetWindowFromOS2Handle(hwnd);
    1066           if(win32wnd == NULL)
     1101          if(win32wnd == NULL) {
     1102            RestoreOS2TIB();
    10671103            return (MRESULT)rc;
    1068 
     1104          }
    10691105          if(!(fsFocusChange & FC_NOSETACTIVE))
    10701106          {
     
    10881124          //SvL: Check if window is still valid
    10891125          win32wnd = Win32BaseWindow::GetWindowFromOS2Handle(hwnd);
    1090           if(win32wnd == NULL)
    1091             return (MRESULT)rc;
     1126          if(win32wnd == NULL) {
     1127            break;
     1128          }
    10921129
    10931130      //TODO: Don't send WM_SETSELECTION to child window if frame already has selection
     
    11121149          win32wnd = Win32BaseWindow::GetWindowFromOS2Handle(hwnd);
    11131150          if(win32wnd == NULL) {
    1114                 return (MRESULT)rc;
     1151            break;
    11151152          }
    11161153
     
    11311168          win32wnd = Win32BaseWindow::GetWindowFromOS2Handle(hwnd);
    11321169          if(win32wnd == NULL)
    1133             return (MRESULT)rc;
     1170            break;
    11341171
    11351172          if(!(fsFocusChange & FC_NOSETACTIVE))
     
    11551192        dprintf(("PMFRAME:WM_FOCUSCHANGE (end) %x %x %x", win32wnd->getWindowHandle(), mp1, mp2));
    11561193#endif
    1157         return (MRESULT)rc;
     1194        break;
    11581195    }
    11591196#endif
     
    11951232            WinSetWindowUShort(hwnd,QWS_FLAGS,mp1 ? (flags | FF_ACTIVE):(flags & ~FF_ACTIVE));
    11961233        }
    1197         RestoreOS2TIB();
    1198         return 0;
     1234        rc = 0;
     1235        break;
    11991236    }
    12001237
    12011238    case WM_ENABLE:
    1202         dprintf(("OS2: WM_ENABLE %x", hwnd));
     1239        dprintf(("PMFRAME: WM_ENABLE %x", hwnd));
    12031240        win32wnd->MsgEnable(SHORT1FROMMP(mp1));
    12041241        break;
    12051242
    12061243    case WM_SHOW:
    1207         dprintf(("OS2: WM_SHOW %x %d", hwnd, mp1));
     1244        dprintf(("PMFRAME: WM_SHOW %x %d", hwnd, mp1));
    12081245        //show client window
    12091246        WinShowWindow(win32wnd->getOS2WindowHandle(), (BOOL)mp1);
    1210         win32wnd->MsgShow((ULONG)mp1);
    12111247        break;
    12121248
    12131249    case WM_SETFOCUS:
    12141250    {
     1251        dprintf(("PMFRAME: WM_SETFOCUS %x %x", win32wnd->getWindowHandle(), hwnd));
    12151252        goto RunDefFrameWndProc;
    12161253    }
     
    12241261        trackInfo->cyBorder = 4;
    12251262        win32wnd->AdjustTrackInfo((PPOINT)&trackInfo->ptlMinTrackSize,(PPOINT)&trackInfo->ptlMaxTrackSize);
    1226         return (MRESULT)TRUE;
     1263        rc = (MRESULT)TRUE;
     1264        break;
    12271265    }
    12281266
     
    12351273        size->x = 0;
    12361274        size->y = 0;
    1237         return (MRESULT)TRUE;
     1275        rc = (MRESULT)TRUE;
     1276        break;
    12381277    }
    12391278
     
    13111350RunDefWndProc:
    13121351    RestoreOS2TIB();
    1313     return WinDefWindowProc( hwnd, msg, mp1, mp2 );
     1352    //calling WinDefWindowProc here break Opera hotlist window (WM_ADJUSTWINDOWPOS)
     1353    return pfnFrameWndProc(hwnd, msg, mp1, mp2);
     1354//    return WinDefWindowProc( hwnd, msg, mp1, mp2 );
    13141355}
    13151356//******************************************************************************
  • TabularUnified trunk/src/user32/window.cpp

    r5685 r5696  
    1 /* $Id: window.cpp,v 1.95 2001-05-11 08:39:46 sandervl Exp $ */
     1/* $Id: window.cpp,v 1.96 2001-05-11 20:40:40 sandervl Exp $ */
    22/*
    33 * Win32 window apis for OS/2
     
    715715HWND WIN32API SetFocus(HWND hwnd)
    716716{
     717 Win32BaseWindow *window;
    717718 HWND lastFocus, lastFocus_W, hwnd_O;
    718719 BOOL activate;
     
    725726    }
    726727
    727     hwnd_O    = Win32ToOS2Handle (hwnd);
    728     lastFocus = OSLibWinQueryFocus (OSLIB_HWND_DESKTOP);
     728    window = Win32BaseWindow::GetWindowFromHandle(hwnd);
     729    if(!window) {
     730        dprintf(("SetFocus, window %x not found", hwnd));
     731        SetLastError(ERROR_INVALID_WINDOW_HANDLE);
     732        return 0;
     733    }
     734
     735    hwnd_O    = window->getOS2FrameWindowHandle();
     736    if(teb->o.odin.hwndFocus) {
     737         lastFocus = teb->o.odin.hwndFocus;
     738    }
     739    else lastFocus = OSLibWinQueryFocus (OSLIB_HWND_DESKTOP);
     740
    729741    activate  = ((hwnd_O == lastFocus) || OSLibWinIsChild (lastFocus, hwnd_O));
    730742    lastFocus_W = OS2ToWin32Handle (lastFocus);
     
    742754        return lastFocus_W;
    743755    }
     756    teb->o.odin.hwndFocus = 0;
    744757    return (OSLibWinSetFocus (OSLIB_HWND_DESKTOP, hwnd_O, activate)) ? lastFocus_W : 0;
    745758}
Note: See TracChangeset for help on using the changeset viewer.