Ignore:
Timestamp:
Feb 13, 2003, 11:34:49 AM (23 years ago)
Author:
sandervl
Message:

Check if WM_KILLFOCUS was already sent by SetFocus(0) call

File:
1 edited

Legend:

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

    r9789 r9792  
    1 /* $Id: pmwindow.cpp,v 1.198 2003-02-12 09:39:44 sandervl Exp $ */
     1/* $Id: pmwindow.cpp,v 1.199 2003-02-13 10:34:49 sandervl Exp $ */
    22/*
    33 * Win32 Window Managment Code for OS/2
     
    5454#include "dragdrop.h"
    5555#include "menu.h"
     56#include "user32api.h"
    5657
    5758#define DBG_LOCALLOG    DBG_pmwindow
     
    257258} /* End of main */
    258259//******************************************************************************
    259 #ifdef NEW_WGSS
    260260HBITMAP OPEN32API _O32_CreateBitmapFromPMHandle(HBITMAP hPMBitmap);
    261261
     
    270270    return yyrc;
    271271}
    272 #endif
    273272//******************************************************************************
    274273static void QueryPMMenuBitmaps()
     
    300299        hbmFrameMenu[PMMENU_CLOSEBUTTONDOWN] = GpiLoadBitmap(hdc, hModDisplay, SBMP_CLOSEDEP, 0, 0);
    301300
    302 #ifdef NEW_WGSS
    303301        //Create win32 bitmap handles of the OS/2 min, max and restore buttons
    304302        hBmpMinButton     = O32_CreateBitmapFromPMHandle(hbmFrameMenu[PMMENU_MINBUTTON]);
     
    310308        hBmpCloseButton   = O32_CreateBitmapFromPMHandle(hbmFrameMenu[PMMENU_CLOSEBUTTON]);
    311309        hBmpCloseButtonDown   = O32_CreateBitmapFromPMHandle(hbmFrameMenu[PMMENU_CLOSEBUTTONDOWN]);
    312 #endif
    313310        DevCloseDC(hdc);
    314311    }
     
    723720        if(WinQueryWindowULong(hwndFocus, OFFSET_WIN32PM_MAGIC) != WIN32PM_MAGIC)
    724721        {
    725                 //another (non-win32) application's window
    726                 //set to NULL (allowed according to win32 SDK) to avoid problems
    727                 hwndFocus = NULL;
     722            //another (non-win32) application's window
     723            //set to NULL (allowed according to win32 SDK) to avoid problems
     724            hwndFocus = NULL;
    728725        }
    729726        if((ULONG)mp2 == TRUE) {
    730                 HWND hwndFocusWin32 = OS2ToWin32Handle(hwndFocus);
    731                 recreateCaret (hwndFocusWin32);
    732                 win32wnd->MsgSetFocus(hwndFocusWin32);
    733         }
    734         else win32wnd->MsgKillFocus(OS2ToWin32Handle(hwndFocus));
     727            HWND hwndFocusWin32 = OS2ToWin32Handle(hwndFocus);
     728            recreateCaret (hwndFocusWin32);
     729            win32wnd->MsgSetFocus(hwndFocusWin32);
     730        }
     731        else {
     732            //If SetFocus(0) was called, then the window has already received
     733            //a WM_KILLFOCUS; don't send another one
     734            if(!fIgnoreKeystrokes) {
     735                 win32wnd->MsgKillFocus(OS2ToWin32Handle(hwndFocus));
     736            }
     737            else dprintf(("Window has already received a WM_KILLFOCUS (SetFocus(0)); ignore"));
     738        }
    735739        teb->o.odin.fWM_SETFOCUS = FALSE;
    736740
Note: See TracChangeset for help on using the changeset viewer.