Changeset 21988 for trunk/src/user32/win32wbase.cpp
- Timestamp:
- Mar 30, 2012, 12:57:21 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/win32wbase.cpp
r21987 r21988 1077 1077 ULONG Win32BaseWindow::MsgButton(MSG *msg) 1078 1078 { 1079 BOOL fClick = FALSE; 1079 BOOL eatMsg = FALSE; 1080 BOOL fClick = FALSE; 1080 1081 1081 1082 dprintf(("MsgButton %d at (%d,%d) %X %X", msg->message, msg->pt.x, msg->pt.y, msg->wParam, msg->lParam)); … … 1117 1118 if(fClick) 1118 1119 { 1119 HWND hwndTop;1120 HWND hwndTop; 1120 1121 1121 1122 /* Activate the window if needed */ … … 1125 1126 if (hwndTop && (getWindowHandle() != hwndActive)) 1126 1127 { 1127 LONG ret = SendMessageA(getWindowHandle(),WM_MOUSEACTIVATE, hwndTop, 1128 MAKELONG( lastHitTestVal, msg->message) ); 1129 1130 //SendMessageA(getWindowHandle(), msg->message, msg->wParam, msg->lParam); 1131 dprintf2(("WM_MOUSEACTIVATE returned %d foreground %x top %x", ret, GetForegroundWindow(), hwndTop)); 1132 #if 0 1133 if ((ret == MA_ACTIVATEANDEAT) || (ret == MA_NOACTIVATEANDEAT)) 1134 eatMsg = TRUE; 1135 #endif 1136 //SvL: 0 is not documented, but experiments in NT4 show that 1137 // the window will get activated when it returns this. 1138 // (FreeCell is an example) 1139 if(((ret == MA_ACTIVATE) || (ret == MA_ACTIVATEANDEAT) || (ret == 0)) 1140 && (hwndTop != GetForegroundWindow()) ) 1141 { 1142 Win32BaseWindow *win32top = Win32BaseWindow::GetWindowFromHandle(hwndTop); 1143 1144 //SvL: Calling OSLibSetActiveWindow(hwndTop); causes focus problems 1145 if (win32top) { 1146 //Must use client window handle (not frame!!) 1147 SetFocus(win32top->getWindowHandle()); 1148 RELEASE_WNDOBJ(win32top); 1149 } 1128 LONG ret = SendMessageA(getWindowHandle(),WM_MOUSEACTIVATE, hwndTop, 1129 MAKELONG( lastHitTestVal, msg->message) ); 1130 1131 //SendMessageA(getWindowHandle(), msg->message, msg->wParam, msg->lParam); 1132 dprintf2(("WM_MOUSEACTIVATE returned %d foreground %x top %x", ret, GetForegroundWindow(), hwndTop)); 1133 1134 if ((ret == MA_ACTIVATEANDEAT) || (ret == MA_NOACTIVATEANDEAT)) 1135 eatMsg = TRUE; 1136 1137 //SvL: 0 is not documented, but experiments in NT4 show that 1138 // the window will get activated when it returns this. 1139 // (FreeCell is an example) 1140 if(((ret == MA_ACTIVATE) || (ret == MA_ACTIVATEANDEAT) || (ret == 0)) 1141 && (hwndTop != GetForegroundWindow()) ) 1142 { 1143 Win32BaseWindow *win32top = Win32BaseWindow::GetWindowFromHandle(hwndTop); 1144 1145 //SvL: Calling OSLibSetActiveWindow(hwndTop); causes focus problems 1146 if (win32top) { 1147 //Must use client window handle (not frame!!) 1148 SetFocus(win32top->getWindowHandle()); 1149 RELEASE_WNDOBJ(win32top); 1150 1150 } 1151 } 1151 1152 } 1152 1153 } … … 1154 1155 SendMessageA(getWindowHandle(),WM_SETCURSOR, getWindowHandle(), MAKELONG(lastHitTestVal, msg->message)); 1155 1156 1156 return SendMessageA(getWindowHandle(),msg->message, msg->wParam, msg->lParam);1157 return eatMsg ? 0 : SendMessageA(getWindowHandle(),msg->message, msg->wParam, msg->lParam); 1157 1158 } 1158 1159 //****************************************************************************** … … 2241 2242 if(window->getStyle() & WS_CHILD && !(window->getExStyle() & WS_EX_NOPARENTNOTIFY) ) 2242 2243 { 2243 /* Notify the parent window only */ 2244 parentwindow = window->getParent(); 2245 if(parentwindow) { 2246 /* PF We should map points for each window accordingly! */ 2247 if (Msg == WM_LBUTTONDOWN || Msg == WM_MBUTTONDOWN || Msg == WM_RBUTTONDOWN || 2248 Msg == WM_LBUTTONUP || Msg == WM_MBUTTONUP || Msg == WM_RBUTTONUP) 2249 { 2250 POINTS pt = MAKEPOINTS(lParam); 2251 POINT point; 2252 2253 point.x = pt.x; 2254 point.y = pt.y; 2255 2256 MapWindowPoints(getWindowHandle(),parentwindow->getWindowHandle(), &point, 1); 2257 lParam = MAKELPARAM(point.x, point.y); 2258 wParam = MAKEWPARAM(Msg, 0 /* undefined according to MSDN, 0 under XP */); 2259 } 2260 else 2261 { 2262 lParam = getWindowHandle(); 2263 wParam = MAKEWPARAM(Msg, getWindowId()); 2264 } 2265 SendMessageA(parentwindow->getWindowHandle(), WM_PARENTNOTIFY, wParam, lParam); 2244 /* Notify the parent window only */ 2245 parentwindow = window->getParent(); 2246 if(parentwindow) { 2247 /* PF We should map points for each window accordingly! */ 2248 if (Msg == WM_LBUTTONDOWN || Msg == WM_MBUTTONDOWN || Msg == WM_RBUTTONDOWN || 2249 Msg == WM_LBUTTONUP || Msg == WM_MBUTTONUP || Msg == WM_RBUTTONUP) 2250 { 2251 POINTS pt = MAKEPOINTS(lParam); 2252 POINT point; 2253 2254 point.x = pt.x; 2255 point.y = pt.y; 2256 2257 MapWindowPoints(getWindowHandle(),parentwindow->getWindowHandle(), &point, 1); 2258 lParam = MAKELPARAM(point.x, point.y); 2259 wParam = MAKEWPARAM(Msg, 0 /* undefined according to MSDN, 0 under XP */); 2266 2260 } 2261 else 2262 { 2263 lParam = getWindowHandle(); 2264 wParam = MAKEWPARAM(Msg, getWindowId()); 2265 } 2266 SendMessageA(parentwindow->getWindowHandle(), WM_PARENTNOTIFY, wParam, lParam); 2267 } 2267 2268 2268 2269 }
Note:
See TracChangeset
for help on using the changeset viewer.