Ignore:
Timestamp:
Jan 2, 2003, 6:02:06 PM (23 years ago)
Author:
sandervl
Message:

corrected regressions caused by previous setfocus fix; make sure owner isn't disabled when specifying SWP_DEACTIVATE

File:
1 edited

Legend:

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

    r9575 r9590  
    1 /* $Id: win32wbase.cpp,v 1.349 2003-01-01 14:29:44 sandervl Exp $ */
     1/* $Id: win32wbase.cpp,v 1.350 2003-01-02 17:02:05 sandervl Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    25802580    swp.hwnd = OS2HwndFrame;
    25812581
     2582    //SvL: Must also deactivate the window when hiding it or else focus won't
     2583    //     change. (NOTE: make sure this doesn't cause regressions (01-02-2003)
     2584    if((swp.fl & (SWPOS_HIDE|SWPOS_DEACTIVATE)) == (SWPOS_HIDE|SWPOS_DEACTIVATE))
     2585    {
     2586        //we must make sure the owner is not disabled or else the focus will
     2587        //be switched to the wrong window
     2588        Win32BaseWindow *topOwner;
     2589
     2590        if(getOwner() == NULL) {
     2591             windowDesktop->addRef();
     2592             topOwner = windowDesktop;
     2593        }
     2594        else topOwner = GetWindowFromHandle(getOwner()->GetTopParent());
     2595
     2596        if(topOwner != NULL) {
     2597             DWORD dwStyle = topOwner->GetWindowLong(GWL_STYLE, FALSE);
     2598             if(dwStyle & WS_DISABLED) {
     2599                 swp.fl &= ~SWPOS_DEACTIVATE;
     2600             }
     2601        }
     2602        else DebugInt3();
     2603    }
     2604
    25822605    if(fuFlags & SWP_SHOWWINDOW && !IsWindowVisible(getWindowHandle())) {
    25832606        setStyle(getStyle() | WS_VISIBLE);
Note: See TracChangeset for help on using the changeset viewer.