Changeset 5696
- Timestamp:
- May 11, 2001, 10:40:40 PM (24 years ago)
- 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.12 7 2001-05-11 19:21:46sandervl Exp $ */1 /* $Id: pmwindow.cpp,v 1.128 2001-05-11 20:40:39 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Managment Code for OS/2 … … 202 202 //probably win32 app user message 203 203 if((ULONG)mp1 == WIN32MSG_MAGICA) { 204 r eturn(MRESULT)win32wnd->DispatchMsgA(pWinMsg);204 rc = (MRESULT)win32wnd->DispatchMsgA(pWinMsg); 205 205 } 206 206 else 207 207 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; 220 212 } 221 213 … … 234 226 if(win32wnd->MsgCreate(hwnd) == FALSE) 235 227 { 236 return (MRESULT)TRUE; //discontinue window creation 228 rc = (MRESULT)TRUE; //discontinue window creation 229 break; 237 230 } 238 231 createfail: 239 return (MRESULT)FALSE; 232 rc = (MRESULT)FALSE; 233 break; 240 234 } 241 235 … … 262 256 case WM_SHOW: 263 257 dprintf(("OS2: WM_SHOW %x %d", hwnd, mp1)); 258 win32wnd->MsgShow((ULONG)mp1); 264 259 break; 265 260 … … 435 430 wndpars->cbCtlData = 0; 436 431 wndpars->cbPresParams = 0; 437 return (MRESULT)TRUE; 432 rc = (MRESULT)TRUE; 433 break; 438 434 } 439 435 goto RunDefWndProc; … … 460 456 { 461 457 dprintf(("OS2: WM_ERASEBACKGROUND %x", win32wnd->getWindowHandle())); 462 return (MRESULT)FALSE; 458 rc = (MRESULT)FALSE; 459 break; 463 460 } 464 461 465 462 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; 468 466 469 467 case WM_REALIZEPALETTE: … … 501 499 goto RunDefWndProc; 502 500 } 501 RestoreOS2TIB(); 503 502 return (MRESULT)rc; 504 503 … … 566 565 } 567 566 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 568 583 case WM_PAINT: 569 584 { … … 597 612 { 598 613 dprintf(("PMFRAME:WM_ERASEBACKGROUND %x", win32wnd->getWindowHandle())); 614 RestoreOS2TIB(); 599 615 return (MRESULT)FALSE; 600 616 } … … 695 711 { 696 712 Win32BaseWindow *wndAfter = Win32BaseWindow::GetWindowFromOS2Handle(pswp->hwndInsertBehind); 713 dprintf2(("SWP_ZORDER: %x %x", pswp->hwndInsertBehind, (wndAfter) ? wndAfter->getWindowHandle() : 0)); 697 714 if(wndAfter) { 698 715 wp.hwndInsertAfter = wndAfter->getWindowHandle(); … … 733 750 pswp->hwnd = hwnd; 734 751 752 RestoreOS2TIB(); 735 753 return (MRESULT)0xf; 736 754 } 755 RestoreOS2TIB(); 737 756 return (MRESULT)0; 738 757 } … … 750 769 if ((pswp->fl & (SWP_SIZE | SWP_MOVE | SWP_ZORDER)) == 0) 751 770 { 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 } 752 778 if(pswp->fl & SWP_ACTIVATE) 753 779 { … … 792 818 { 793 819 Win32BaseWindow *wndAfter = Win32BaseWindow::GetWindowFromOS2Handle(pswp->hwndInsertBehind); 820 dprintf2(("SWP_ZORDER: %x %x", pswp->hwndInsertBehind, (wndAfter) ? wndAfter->getWindowHandle() : 0)); 794 821 if(wndAfter) { 795 822 wp.hwndInsertAfter = wndAfter->getWindowHandle(); … … 801 828 WinShowWindow(win32wnd->getOS2WindowHandle(), 1); 802 829 } 830 else 831 if(pswp->fl & SWP_HIDE) { 832 WinShowWindow(win32wnd->getOS2WindowHandle(), 0); 833 } 834 803 835 #ifndef USE_CALCVALIDRECT 804 836 if((pswp->fl & (SWP_MOVE | SWP_SIZE))) … … 913 945 914 946 PosChangedEnd: 947 RestoreOS2TIB(); 915 948 return (MRESULT)FALSE; 916 949 } … … 999 1032 newRect->yBottom += newClientRect.yBottom; 1000 1033 } 1034 RestoreOS2TIB(); 1001 1035 return (MRESULT)res; 1002 1036 } 1003 1037 #else 1004 1038 dprintf(("PMWINDOW: WM_CALCVALIDRECTS %x", win32wnd->getWindowHandle())); 1039 RestoreOS2TIB(); 1005 1040 return (MRESULT)(CVR_ALIGNLEFT | CVR_ALIGNTOP); 1006 1041 #endif … … 1021 1056 dprintf(("PMFRAME:WM_QUERYFOCUSCHAIN %x fsCmd %x parent %x", win32wnd->getWindowHandle(), SHORT1FROMMP(mp1), mp2)); 1022 1057 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; 1029 1064 #endif 1030 1065 … … 1064 1099 //SvL: Check if window is still valid 1065 1100 win32wnd = Win32BaseWindow::GetWindowFromOS2Handle(hwnd); 1066 if(win32wnd == NULL) 1101 if(win32wnd == NULL) { 1102 RestoreOS2TIB(); 1067 1103 return (MRESULT)rc; 1068 1104 } 1069 1105 if(!(fsFocusChange & FC_NOSETACTIVE)) 1070 1106 { … … 1088 1124 //SvL: Check if window is still valid 1089 1125 win32wnd = Win32BaseWindow::GetWindowFromOS2Handle(hwnd); 1090 if(win32wnd == NULL) 1091 return (MRESULT)rc; 1126 if(win32wnd == NULL) { 1127 break; 1128 } 1092 1129 1093 1130 //TODO: Don't send WM_SETSELECTION to child window if frame already has selection … … 1112 1149 win32wnd = Win32BaseWindow::GetWindowFromOS2Handle(hwnd); 1113 1150 if(win32wnd == NULL) { 1114 return (MRESULT)rc;1151 break; 1115 1152 } 1116 1153 … … 1131 1168 win32wnd = Win32BaseWindow::GetWindowFromOS2Handle(hwnd); 1132 1169 if(win32wnd == NULL) 1133 return (MRESULT)rc;1170 break; 1134 1171 1135 1172 if(!(fsFocusChange & FC_NOSETACTIVE)) … … 1155 1192 dprintf(("PMFRAME:WM_FOCUSCHANGE (end) %x %x %x", win32wnd->getWindowHandle(), mp1, mp2)); 1156 1193 #endif 1157 return (MRESULT)rc;1194 break; 1158 1195 } 1159 1196 #endif … … 1195 1232 WinSetWindowUShort(hwnd,QWS_FLAGS,mp1 ? (flags | FF_ACTIVE):(flags & ~FF_ACTIVE)); 1196 1233 } 1197 RestoreOS2TIB();1198 return 0;1234 rc = 0; 1235 break; 1199 1236 } 1200 1237 1201 1238 case WM_ENABLE: 1202 dprintf((" OS2: WM_ENABLE %x", hwnd));1239 dprintf(("PMFRAME: WM_ENABLE %x", hwnd)); 1203 1240 win32wnd->MsgEnable(SHORT1FROMMP(mp1)); 1204 1241 break; 1205 1242 1206 1243 case WM_SHOW: 1207 dprintf((" OS2: WM_SHOW %x %d", hwnd, mp1));1244 dprintf(("PMFRAME: WM_SHOW %x %d", hwnd, mp1)); 1208 1245 //show client window 1209 1246 WinShowWindow(win32wnd->getOS2WindowHandle(), (BOOL)mp1); 1210 win32wnd->MsgShow((ULONG)mp1);1211 1247 break; 1212 1248 1213 1249 case WM_SETFOCUS: 1214 1250 { 1251 dprintf(("PMFRAME: WM_SETFOCUS %x %x", win32wnd->getWindowHandle(), hwnd)); 1215 1252 goto RunDefFrameWndProc; 1216 1253 } … … 1224 1261 trackInfo->cyBorder = 4; 1225 1262 win32wnd->AdjustTrackInfo((PPOINT)&trackInfo->ptlMinTrackSize,(PPOINT)&trackInfo->ptlMaxTrackSize); 1226 return (MRESULT)TRUE; 1263 rc = (MRESULT)TRUE; 1264 break; 1227 1265 } 1228 1266 … … 1235 1273 size->x = 0; 1236 1274 size->y = 0; 1237 return (MRESULT)TRUE; 1275 rc = (MRESULT)TRUE; 1276 break; 1238 1277 } 1239 1278 … … 1311 1350 RunDefWndProc: 1312 1351 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 ); 1314 1355 } 1315 1356 //****************************************************************************** -
TabularUnified trunk/src/user32/window.cpp ¶
r5685 r5696 1 /* $Id: window.cpp,v 1.9 5 2001-05-11 08:39:46sandervl Exp $ */1 /* $Id: window.cpp,v 1.96 2001-05-11 20:40:40 sandervl Exp $ */ 2 2 /* 3 3 * Win32 window apis for OS/2 … … 715 715 HWND WIN32API SetFocus(HWND hwnd) 716 716 { 717 Win32BaseWindow *window; 717 718 HWND lastFocus, lastFocus_W, hwnd_O; 718 719 BOOL activate; … … 725 726 } 726 727 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 729 741 activate = ((hwnd_O == lastFocus) || OSLibWinIsChild (lastFocus, hwnd_O)); 730 742 lastFocus_W = OS2ToWin32Handle (lastFocus); … … 742 754 return lastFocus_W; 743 755 } 756 teb->o.odin.hwndFocus = 0; 744 757 return (OSLibWinSetFocus (OSLIB_HWND_DESKTOP, hwnd_O, activate)) ? lastFocus_W : 0; 745 758 }
Note:
See TracChangeset
for help on using the changeset viewer.