Changeset 10033 for trunk/src


Ignore:
Timestamp:
Apr 24, 2003, 3:59:15 PM (22 years ago)
Author:
sandervl
Message:

EndDialog: Enable owner window regardless of whether it was enabled before dialog creation & check for fake windows in GetWindowFromOS2Handle

Location:
trunk/src/user32
Files:
3 edited

Legend:

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

    r9526 r10033  
    1 /* $Id: win32dlg.cpp,v 1.80 2002-12-18 14:04:24 sandervl Exp $ */
     1/* $Id: win32dlg.cpp,v 1.81 2003-04-24 13:59:14 sandervl Exp $ */
    22/*
    33 * Win32 Dialog Code for OS/2
     
    2727#include <math.h>
    2828#include <unicode.h>
     29#include "user32api.h"
    2930
    3031#define DBG_LOCALLOG    DBG_win32dlg
     
    3435
    3536#define GET_SHORT(ptr)     (*(SHORT *)(ptr))
     37
    3638
    3739//******************************************************************************
     
    11371139    /* Windows sets the focus to the dialog itself in EndDialog */
    11381140
     1141#ifdef __WIN32OS2__
     1142    if (::IsChild(hwnd, GetFocus()))
     1143    {
     1144       ::SetFocus( hwnd );
     1145       //SvL: Enable the owner if the focus is on one of its children.
     1146       //     If we don't, then PM will switch focus to another app since
     1147       //     we hide the window below (hidden windows cannot have focus)
     1148       HWND owner = ::GetWindow( hwnd, GW_OWNER);
     1149       if(owner)
     1150           ::EnableWindow(owner, TRUE);
     1151    }
     1152#else
    11391153    if (::IsChild(hwnd, GetFocus()))
    11401154       ::SetFocus( hwnd );
     1155#endif
    11411156
    11421157    /* Don't have to send a ShowWindow(SW_HIDE), just do
  • trunk/src/user32/win32wbase.cpp

    r10031 r10033  
    1 /* $Id: win32wbase.cpp,v 1.367 2003-04-23 18:00:59 sandervl Exp $ */
     1/* $Id: win32wbase.cpp,v 1.368 2003-04-24 13:59:14 sandervl Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    4848#include <custombuild.h>
    4949#include "win32wbase.h"
     50#include "win32wfake.h"
    5051#include "wndmsg.h"
    5152#include "oslibwin.h"
     
    11431144                                        MAKELONG( lastHitTestVal, msg->message) );
    11441145
    1145                 dprintf2(("WM_MOUSEACTIVATE returned %d", ret));
     1146                dprintf2(("WM_MOUSEACTIVATE returned %d foreground %x top %x", ret, GetForegroundWindow(), hwndTop));
    11461147#if 0
    11471148                if ((ret == MA_ACTIVATEANDEAT) || (ret == MA_NOACTIVATEANDEAT))
     
    11571158
    11581159                    //SvL: Calling OSLibSetActiveWindow(hwndTop); causes focus problems
    1159                     if (win32top && !win32top->isFakeWindow()) {
     1160                    if (win32top) {
    11601161                        //Must use client window handle (not frame!!)
    11611162                        SetFocus(win32top->getWindowHandle());
     
    26252626            NotifyFrameChanged(&wpos, &oldClientRect);
    26262627        }
    2627         if(!fShowWindow && !(getStyle() & WS_MINIMIZE) && !(fuFlags & (SWP_NOSIZE | SWP_NOMOVE)))
     2628        if(!fShowWindow && !(getStyle() & (WS_MINIMIZE|WS_MAXIMIZE)) && !(fuFlags & (SWP_NOSIZE | SWP_NOMOVE)))
    26282629        {
    26292630            //Restore position always changes when the window position is changed
     
    27002701        NotifyFrameChanged(&wpos, &oldClientRect);
    27012702    }
    2702     if(!fShowWindow && !(getStyle() & WS_MINIMIZE))
     2703    if(!fShowWindow && !(getStyle() & (WS_MINIMIZE|WS_MAXIMIZE)))
    27032704    {
    27042705        //Restore position always changes when the window position is changed
     
    36173618}
    36183619//******************************************************************************
    3619 //WM_ENABLE is sent to hwnd, but not to it's children (as it should be)
     3620//WM_ENABLE is sent to hwnd, but not to its children (as it should be)
    36203621//******************************************************************************
    36213622BOOL Win32BaseWindow::EnableWindow(BOOL fEnable)
     
    41154116    }
    41164117//  dprintf2(("Win32BaseWindow::GetWindowFromOS2Handle: not an Odin os2 window %x", hwndOS2));
     4118
     4119    //Now check if it's a fake window
     4120    Win32FakeWindow *window = Win32FakeWindow::GetWindowFromOS2Handle(hwndOS2);
     4121    if(window) {
     4122        return window;
     4123    }
    41174124    return 0;
    41184125}
  • trunk/src/user32/win32wfake.cpp

    r10031 r10033  
    1 /* $Id: win32wfake.cpp,v 1.3 2003-04-23 18:01:01 sandervl Exp $ */
     1/* $Id: win32wfake.cpp,v 1.4 2003-04-24 13:59:15 sandervl Exp $ */
    22/*
    33 * Win32 Fake Window Class for OS/2
     
    251251        DebugInt3();
    252252    }
    253     dprintf(("Win32FakeWindow::GetWindowFromOS2Handle(%x) -> null", hwndOS2));
     253    dprintf2(("Win32FakeWindow::GetWindowFromOS2Handle(%x) -> null", hwndOS2));
    254254    return NULL;
    255255}
Note: See TracChangeset for help on using the changeset viewer.