- Timestamp:
- Jun 3, 2003, 1:58:57 PM (22 years ago)
- Location:
- trunk/src/user32
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/pmwindow.cpp
r10078 r10136 1 /* $Id: pmwindow.cpp,v 1.21 5 2003-05-07 16:13:26sandervl Exp $ */1 /* $Id: pmwindow.cpp,v 1.216 2003-06-03 11:58:37 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Managment Code for OS/2 … … 60 60 #include "dbglocal.h" 61 61 62 63 // Notification that focus change has completed (UNDOCUMENTED) 64 #define WM_FOCUSCHANGED 0x000e 65 62 66 //define this to use the new code for WM_CALCVALIDRECT handling 63 67 //#define USE_CALCVALIDRECT … … 727 731 break; 728 732 729 case WIN32APP_SETFOCUSMSG: 733 case WIN32APP_CHNGEFRAMECTRLS: 734 { 735 dprintf(("OS2: WIN32APP_CHANGEFRAMECTRLS")); 736 OSLibSetWindowStyle(win32wnd->getOS2FrameWindowHandle(), win32wnd->getOS2WindowHandle(), (ULONG)mp1, win32wnd->getExStyle(), (ULONG)mp2); 737 break; 738 } 739 740 case WM_SETFOCUS: 741 { 742 HWND hwndFocus = (HWND)mp1; 743 dprintf(("OS2: WM_SETFOCUS %x %x (%x) %d cur focus %x", win32wnd->getWindowHandle(), mp1, OS2ToWin32Handle(hwndFocus), mp2, WinQueryFocus(HWND_DESKTOP))); 744 break; 745 } 746 747 //Handle all focus processed during WM_FOCUSCHANGED; PM doesn't like focus 748 //changes during focus processing (WM_SETFOCUS). This message is sent 749 //after all focus work has been completed. 750 case WM_FOCUSCHANGED: 751 { 752 HWND hwndFocus = (HWND)mp1; 753 HWND hwndFocusWin32 = OS2ToWin32Handle(hwndFocus); 754 755 dprintf(("OS2: WM_FOCUSCHANGED %x %x (%x) %d cur focus %x", win32wnd->getWindowHandle(), mp1, OS2ToWin32Handle(hwndFocus), mp2, WinQueryFocus(HWND_DESKTOP))); 756 730 757 //PM doesn't allow SetFocus calls during WM_SETFOCUS message processing; 731 758 //must delay this function call 732 //mp1 = win32 window handle 733 //mp2 = top parent if activation required 734 dprintf(("USER32: Delayed SetFocus %x %x %x call!", teb->o.odin.hwndFocus, mp1, mp2)); 735 if(teb->o.odin.hwndFocus) { 736 RELEASE_WNDOBJ(win32wnd); 737 win32wnd = Win32BaseWindow::GetWindowFromHandle(teb->o.odin.hwndFocus); 738 if(win32wnd) { 739 if(mp2) { 740 SetActiveWindow((HWND)mp2); 741 } 742 if(!IsWindow(win32wnd->getWindowHandle())) break; //abort if window destroyed 743 WinFocusChange(HWND_DESKTOP, win32wnd->getOS2WindowHandle(), FC_NOSETACTIVE); 744 } 745 else DebugInt3(); 746 } 747 break; 748 749 case WIN32APP_CHNGEFRAMECTRLS: 750 { 751 dprintf(("OS2: WIN32APP_CHANGEFRAMECTRLS")); 752 OSLibSetWindowStyle(win32wnd->getOS2FrameWindowHandle(), win32wnd->getOS2WindowHandle(), (ULONG)mp1, win32wnd->getExStyle(), (ULONG)mp2); 753 break; 754 } 755 756 case WM_SETFOCUS: 757 { 758 HWND hwndFocus = (HWND)mp1; 759 760 dprintf(("OS2: WM_SETFOCUS %x %x (%x) %d cur focus %x", win32wnd->getWindowHandle(), mp1, OS2ToWin32Handle(hwndFocus), mp2, WinQueryFocus(HWND_DESKTOP))); 761 762 //PM doesn't allow SetFocus calls during WM_SETFOCUS message processing; 763 //must delay this function call 764 765 teb->o.odin.fWM_SETFOCUS = TRUE; 766 teb->o.odin.hwndFocus = 0; 759 767 760 if(WinQueryWindowULong(hwndFocus, OFFSET_WIN32PM_MAGIC) != WIN32PM_MAGIC) 768 761 { 769 762 //another (non-win32) application's window 770 763 //set to NULL (allowed according to win32 SDK) to avoid problems 771 hwndFocus = NULL; 764 hwndFocus = 0; 765 hwndFocusWin32 = 0; 772 766 } 773 767 if((ULONG)mp2 == TRUE) { 774 HWND hwndFocusWin32 = OS2ToWin32Handle(hwndFocus); 775 recreateCaret (hwndFocusWin32); 768 recreateCaret(hwndFocusWin32); 776 769 win32wnd->MsgSetFocus(hwndFocusWin32); 777 770 } … … 784 777 else dprintf(("Window has already received a WM_KILLFOCUS (SetFocus(0)); ignore")); 785 778 } 786 teb->o.odin.fWM_SETFOCUS = FALSE;787 788 779 break; 789 780 } -
trunk/src/user32/window.cpp
r9974 r10136 1 /* $Id: window.cpp,v 1.13 4 2003-04-02 12:58:02sandervl Exp $ */1 /* $Id: window.cpp,v 1.135 2003-06-03 11:58:38 sandervl Exp $ */ 2 2 /* 3 3 * Win32 window apis for OS/2 … … 781 781 782 782 hwnd_O = window->getOS2WindowHandle(); 783 if(teb->o.odin.hwndFocus) { 784 lastFocus = teb->o.odin.hwndFocus; 785 } 786 else lastFocus = OSLibWinQueryFocus (OSLIB_HWND_DESKTOP); 783 lastFocus = OSLibWinQueryFocus (OSLIB_HWND_DESKTOP); 787 784 788 785 hwndTopParent = window->GetTopParent(); … … 806 803 } 807 804 808 //PM doesn't allow SetFocus calls during WM_SETFOCUS message processing;809 //must delay this function call810 if(teb->o.odin.fWM_SETFOCUS) {811 dprintf(("USER32: Delay SetFocus call!"));812 teb->o.odin.hwndFocus = hwnd;813 814 //If keystrokes were ignored and focus is set to the old focus window, then815 //PM won't send us a WM_SETFOCUS message. (as we don't inform PM for SetFocus(0))816 if(fIgnoreKeystrokes && lastFocus_W == hwnd) {817 dprintf(("Manually send WM_SETFOCUS; real focus window hasn't changed"));818 SendMessageA(lastFocus_W, WM_SETFOCUS, 0, 0);819 }820 else {821 //mp1 = win32 window handle822 //mp2 = top parent if activation required823 OSLibPostMessageDirect(hwnd_O, WIN32APP_SETFOCUSMSG, hwnd, (activate) ? hwndTopParent : 0);824 }825 RELEASE_WNDOBJ(window);826 return lastFocus_W;827 }828 teb->o.odin.hwndFocus = 0;829 805 if(!IsWindow(hwnd)) return FALSE; //abort if window destroyed 830 806 … … 839 815 SendMessageA(lastFocus_W, WM_SETFOCUS, 0, 0); 840 816 } 841 842 817 fIgnoreKeystrokes = FALSE; 843 818 return ret; … … 860 835 return 0; 861 836 } 862 //PM doesn't allow SetFocus calls during WM_SETFOCUS message processing;863 //If focus was changed during WM_SETFOCUS, the focus window handle is864 //stored in teb->o.odin.hwndFocus (set back to 0 when delayed SetFocus865 //is activated)866 if(teb->o.odin.hwndFocus) {867 dprintf(("USER32: GetFocus %x (DURING WM_SETFOCUS PROCESSING)", teb->o.odin.hwndFocus));868 return teb->o.odin.hwndFocus;869 }870 871 837 hwnd = OSLibWinQueryFocus(OSLIB_HWND_DESKTOP); 872 838 hwnd = OS2ToWin32Handle(hwnd);
Note:
See TracChangeset
for help on using the changeset viewer.