Changeset 963 for trunk/src


Ignore:
Timestamp:
Sep 17, 1999, 8:49:53 PM (26 years ago)
Author:
dengert
Message:

window focus management fixed

Location:
trunk/src/user32
Files:
4 edited

Legend:

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

    r949 r963  
    1 /* $Id: oslibwin.cpp,v 1.1 1999-09-15 23:18:54 sandervl Exp $ */
     1/* $Id: oslibwin.cpp,v 1.2 1999-09-17 18:49:53 dengert Exp $ */
    22/*
    33 * Window API wrappers for OS/2
     
    183183//******************************************************************************
    184184//******************************************************************************
    185 BOOL OSLibWinSetFocus(HWND hwndDeskTop,HWND hwndNewFocus)
    186 {
    187   return WinSetFocus(hwndDeskTop,hwndNewFocus);
     185BOOL OSLibWinSetFocus(HWND hwndDeskTop,HWND hwndNewFocus, BOOL activate)
     186{
     187  return WinFocusChange (hwndDeskTop, hwndNewFocus, activate ? FC_NOLOSEACTIVE : 0);
     188}
     189//******************************************************************************
     190//******************************************************************************
     191BOOL OSLibWinIsChild (HWND hwnd, HWND hwndOf)
     192{
     193  return WinIsChild (hwnd, hwndOf);
    188194}
    189195//******************************************************************************
     
    677683HWND OSLibWinBeginEnumWindows(HWND hwnd)
    678684{
    679    if(hwnd == OSLIB_HWND_DESKTOP)       hwnd = HWND_DESKTOP;
     685   if(hwnd == OSLIB_HWND_DESKTOP)       hwnd = HWND_DESKTOP;
    680686   else
    681    if(hwnd == OSLIB_HWND_OBJECT)        hwnd = HWND_OBJECT;
     687   if(hwnd == OSLIB_HWND_OBJECT)        hwnd = HWND_OBJECT;
    682688
    683689   return WinBeginEnumWindows(hwnd);
  • trunk/src/user32/oslibwin.h

    r949 r963  
    1 /* $Id: oslibwin.h,v 1.1 1999-09-15 23:18:55 sandervl Exp $ */
     1/* $Id: oslibwin.h,v 1.2 1999-09-17 18:49:53 dengert Exp $ */
    22/*
    33 * Window API wrappers for OS/2
     
    3030#endif
    3131
    32 #define OSLIB_HWND_DESKTOP      0
    33 #define OSLIB_HWND_OBJECT       1
     32#define OSLIB_HWND_DESKTOP      1
     33#define OSLIB_HWND_OBJECT       2
    3434
    3535BOOL  OSLibWinSetParent(HWND hwnd, HWND hwndParent, ULONG fRedraw = TRUE);
     
    5555HWND OSLibWinQueryFocus(HWND hwndDeskTop);
    5656HWND OSLibWinWindowFromID(HWND hwndParent,ULONG id);
    57 BOOL OSLibWinSetFocus(HWND hwndDeskTop,HWND hwndNewFocus);
     57BOOL OSLibWinSetFocus(HWND hwndDeskTop,HWND hwndNewFocus, BOOL activate);
    5858ULONG OSLibGetWindowHeight(HWND hwnd); //for point transformation
    5959
     
    195195
    196196BOOL  OSLibWinIsIconic(HWND hwnd);
     197BOOL  OSLibWinIsChild (HWND hwnd, HWND hwndOf);
    197198BOOL  OSLibWinSetActiveWindow(HWND hwnd);
    198199BOOL  OSLibWinSetFocus(HWND hwnd);
  • trunk/src/user32/win32wbase.cpp

    r949 r963  
    1 /* $Id: win32wbase.cpp,v 1.1 1999-09-15 23:19:01 sandervl Exp $ */
     1/* $Id: win32wbase.cpp,v 1.2 1999-09-17 18:49:53 dengert Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    896896            SendInternalMessageA(WM_ACTIVATEAPP, TRUE, 0); //TODO: Need thread id from hwnd app
    897897    }
    898     return  SendInternalMessageA(WM_SETFOCUS, hwnd, 0);
     898    return  SendInternalMessageA(WM_SETFOCUS, OS2ToWin32Handle (hwnd), 0);
    899899}
    900900//******************************************************************************
     
    906906            SendInternalMessageA(WM_ACTIVATEAPP, FALSE, 0); //TODO: Need thread id from hwnd app
    907907    }
    908     return  SendInternalMessageA(WM_KILLFOCUS, hwnd, 0);
    909 }
     908    return  SendInternalMessageA(WM_KILLFOCUS, OS2ToWin32Handle (hwnd), 0);
     909}
     910//******************************************************************************
    910911//******************************************************************************
    911912//******************************************************************************
  • trunk/src/user32/window.cpp

    r962 r963  
    1 /* $Id: window.cpp,v 1.2 1999-09-16 18:00:43 dengert Exp $ */
     1/* $Id: window.cpp,v 1.3 1999-09-17 18:49:53 dengert Exp $ */
    22/*
    33 * Win32 window apis for OS/2
     
    456456//******************************************************************************
    457457//******************************************************************************
    458 HWND WIN32API SetFocus( HWND hwnd)
    459 {
    460  HWND lastFocus;
    461 
    462     dprintf(("USER32:  SetFocus\n"));
    463 
    464     lastFocus = GetFocus();
    465     hwnd = Win32BaseWindow::Win32ToOS2Handle(hwnd);
    466     return (OSLibWinSetFocus(OSLIB_HWND_DESKTOP,hwnd)) ? lastFocus:0;
     458HWND WIN32API SetFocus (HWND hwnd)
     459{
     460    HWND lastFocus, lastFocus_W, hwnd_O;
     461    BOOL activate;
     462
     463    hwnd_O    = Win32BaseWindow::Win32ToOS2Handle (hwnd);
     464    lastFocus = OSLibWinQueryFocus (OSLIB_HWND_DESKTOP);
     465    activate  = ((hwnd_O == lastFocus) || OSLibWinIsChild (lastFocus, hwnd_O));
     466    lastFocus_W = Win32BaseWindow::OS2ToWin32Handle (lastFocus);
     467
     468    dprintf(("USER32:  SetFocus %x (%x) -> %x (%x)\n", lastFocus_W, lastFocus, hwnd, hwnd_O));
     469
     470    return (OSLibWinSetFocus (OSLIB_HWND_DESKTOP, hwnd_O, activate)) ? lastFocus_W : 0;
    467471}
    468472//******************************************************************************
Note: See TracChangeset for help on using the changeset viewer.