Ignore:
Timestamp:
Aug 13, 2002, 10:39:51 PM (23 years ago)
Author:
sandervl
Message:

Enable owner of window destroyed by DestroyWindow. Disabled owners will never be activated by PM

File:
1 edited

Legend:

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

    r8993 r8999  
    1 /* $Id: win32wbase.cpp,v 1.333 2002-08-13 10:04:58 sandervl Exp $ */
     1/* $Id: win32wbase.cpp,v 1.334 2002-08-13 20:39:51 sandervl Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    6666#define INCL_TIMERWIN32
    6767#include "timer.h"
     68#include "user32api.h"
    6869
    6970#define DBG_LOCALLOG    DBG_win32wbase
     
    26852686BOOL Win32BaseWindow::DestroyWindow()
    26862687{
    2687   HWND hwnd = getWindowHandle();
     2688    HWND hwnd = getWindowHandle();
    26882689
    26892690    dprintf(("DestroyWindow %x", hwnd));
    26902691
     2692#if 0
     2693    /* Look whether the focus is within the tree of windows we will
     2694     * be destroying.
     2695     */
     2696    HWND hwndFocus = GetFocus();
     2697    if (hwndFocus == hwnd || ::IsChild( hwnd, hwndFocus ))
     2698    {
     2699        HWND parent = GetAncestor( hwnd, GA_PARENT );
     2700        if (parent == GetDesktopWindow()) parent = 0;
     2701        SetFocus( parent );
     2702    }
     2703#endif
    26912704    /* Call hooks */
    26922705    if(HOOK_CallHooksA( WH_CBT, HCBT_DESTROYWND, getWindowHandle(), 0L))
     
    27322745        if (owner->getLastActive() == hwnd)
    27332746            owner->setLastActive( owner->getWindowHandle() );
     2747
     2748        //SvL: Not sure this is correct, but it solves the problem of reassigning
     2749        //     activation. A disabled window will never be activated ->
     2750        //     possible that the wrong window is chosen by PM.
     2751        //     PM chooses another window to be activated before WM_DESTROY is
     2752        //     sent. VPC enables the owner when it receives that message,
     2753        //     but by then it's too late.
     2754        ::EnableWindow(owner->getWindowHandle(), 1);
    27342755    }
    27352756 
Note: See TracChangeset for help on using the changeset viewer.