Ignore:
Timestamp:
Jun 3, 2003, 1:58:57 PM (22 years ago)
Author:
sandervl
Message:

Send focus messages when we receive the undocumented WM_FOCUSCHANGED PM message. Removes the need for the ugly hack to deal with nested focus changes.

File:
1 edited

Legend:

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

    r9974 r10136  
    1 /* $Id: window.cpp,v 1.134 2003-04-02 12:58:02 sandervl Exp $ */
     1/* $Id: window.cpp,v 1.135 2003-06-03 11:58:38 sandervl Exp $ */
    22/*
    33 * Win32 window apis for OS/2
     
    781781
    782782    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);
    787784
    788785    hwndTopParent = window->GetTopParent();
     
    806803    }
    807804
    808     //PM doesn't allow SetFocus calls during WM_SETFOCUS message processing;
    809     //must delay this function call
    810     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, then
    815         //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 handle
    822             //mp2 = top parent if activation required
    823             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;
    829805    if(!IsWindow(hwnd)) return FALSE;       //abort if window destroyed
    830806
     
    839815        SendMessageA(lastFocus_W, WM_SETFOCUS, 0, 0);
    840816    }
    841 
    842817    fIgnoreKeystrokes = FALSE;
    843818    return ret;
     
    860835        return 0;
    861836    }
    862     //PM doesn't allow SetFocus calls during WM_SETFOCUS message processing;
    863     //If focus was changed during WM_SETFOCUS, the focus window handle is
    864     //stored in teb->o.odin.hwndFocus (set back to 0 when delayed SetFocus
    865     //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 
    871837    hwnd = OSLibWinQueryFocus(OSLIB_HWND_DESKTOP);
    872838    hwnd = OS2ToWin32Handle(hwnd);
Note: See TracChangeset for help on using the changeset viewer.