Ignore:
Timestamp:
Feb 15, 2001, 1:33:01 AM (25 years ago)
Author:
sandervl
Message:

SetFocus fixes during WM_SETFOCUS

File:
1 edited

Legend:

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

    r4945 r5137  
    1 /* $Id: pmwindow.cpp,v 1.112 2001-01-14 17:15:46 sandervl Exp $ */
     1/* $Id: pmwindow.cpp,v 1.113 2001-02-15 00:33:01 sandervl Exp $ */
    22/*
    33 * Win32 Window Managment Code for OS/2
     
    2121#include <string.h>
    2222#include <win32type.h>
     23#include <win32api.h>
    2324#include <winconst.h>
    2425#include <winuser32.h>
     
    219220        }
    220221  }
     222  else
     223  if(msg == WIN32APP_SETFOCUSMSG) {
     224      //PM doesn't allow SetFocus calls during WM_SETFOCUS message processing;
     225      //must delay this function call
     226      //mp1 = win32 window handle
     227      //mp2 = activate flag
     228      dprintf(("USER32: Delayed SetFocus %x call!", mp1));
     229      teb->o.odin.hwndFocus = 0;
     230      WinFocusChange(HWND_DESKTOP, hwnd, mp2 ? FC_NOLOSEACTIVE : 0);
     231  }
    221232
    222233  switch( msg )
     
    282293        if (win32wnd->IsModalDialogOwner())
    283294        {
     295            dprintf(("win32wnd->IsModalDialogOwner %x", win32wnd->getWindowHandle()));
    284296            pswp->fl |= SWP_ZORDER;
    285297            pswp->hwndInsertBehind = win32wnd->getOS2HwndModalDialog();
     
    584596    {
    585597      HWND hwndFocus = (HWND)mp1;
    586 
     598       
    587599        dprintf(("OS2: WM_SETFOCUS %x %x (%x) %d", win32wnd->getWindowHandle(), mp1, OS2ToWin32Handle(hwndFocus), mp2));
     600
     601        //PM doesn't allow SetFocus calls during WM_SETFOCUS message processing;
     602        //must delay this function call
     603
     604        teb->o.odin.fWM_SETFOCUS = TRUE;
     605        teb->o.odin.hwndFocus    = 0;
    588606        if(WinQueryWindowULong(hwndFocus, OFFSET_WIN32PM_MAGIC) != WIN32PM_MAGIC) {
    589607                //another (non-win32) application's window
     
    597615        }
    598616        else win32wnd->MsgKillFocus(OS2ToWin32Handle(hwndFocus));
     617        teb->o.odin.fWM_SETFOCUS = FALSE;
     618
    599619        break;
    600620    }
     
    12001220        }
    12011221        else {
    1202             WinSetWindowPos(win32wnd->getOS2WindowHandle(),
    1203                                         0, track.rclTrack.xLeft, track.rclTrack.yBottom,
    1204                                         track.rclTrack.xRight - track.rclTrack.xLeft,
    1205                                         track.rclTrack.yTop - track.rclTrack.yBottom,
    1206                                         SWP_SIZE|SWP_MOVE);
     1222              SetWindowPos(win32wnd->getWindowHandle(), 0, track.rclTrack.xLeft,
     1223                           parentHeight - track.rclTrack.yTop,
     1224                           track.rclTrack.xRight - track.rclTrack.xLeft,
     1225                           track.rclTrack.yTop - track.rclTrack.yBottom,
     1226                           SWP_NOACTIVATE_W | SWP_NOZORDER_W | SWP_NOACTIVATE_W);
     1227//            WinSetWindowPos(win32wnd->getOS2WindowHandle(),
     1228//                                        0, track.rclTrack.xLeft, track.rclTrack.yBottom,
     1229//                                        track.rclTrack.xRight - track.rclTrack.xLeft,
     1230//                                        track.rclTrack.yTop - track.rclTrack.yBottom,
     1231//                                        SWP_SIZE|SWP_MOVE);
    12071232        }
    12081233        }
Note: See TracChangeset for help on using the changeset viewer.