Ignore:
Timestamp:
Jan 13, 2000, 2:54:55 PM (26 years ago)
Author:
sandervl
Message:

wm_activate fixes, scrollbar fix, drawframe fix

File:
1 edited

Legend:

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

    r2421 r2426  
    1 /* $Id: win32wbase.cpp,v 1.37 2000-01-12 17:37:29 cbratschi Exp $ */
     1/* $Id: win32wbase.cpp,v 1.38 2000-01-13 13:54:53 sandervl Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    834834//******************************************************************************
    835835//******************************************************************************
    836 ULONG Win32BaseWindow::MsgActivate(BOOL fActivate, BOOL fMinimized, HWND hwnd)
    837 {
    838  ULONG rc, curprocid, procidhwnd = -1, threadidhwnd = 0;
     836ULONG Win32BaseWindow::MsgActivate(BOOL fActivate, BOOL fMinimized, HWND hwnd, HWND hwndOS2Win)
     837{
     838 ULONG rc, procidhwnd = -1, threadidhwnd = 0;
    839839
    840840
     
    842842    //default processing is cancelled
    843843    //TODO: According to Wine we should proceed anyway if window is sysmodal
     844#if 0
    844845    if(SendInternalMessageA(WM_NCACTIVATE, fActivate, 0) == FALSE && !fActivate)
    845846    {
    846847        return 0;
    847848    }
     849#endif
    848850    rc = SendInternalMessageA(WM_ACTIVATE, MAKELONG((fActivate) ? WA_ACTIVE : WA_INACTIVE, fMinimized), hwnd);
    849851
    850     curprocid  = GetCurrentProcessId();
    851     if(hwnd) {
    852             threadidhwnd = GetWindowThreadProcessId(hwnd, &procidhwnd);
    853     }
    854 
    855     if(curprocid != procidhwnd && fActivate) {
    856         SendInternalMessageA(WM_ACTIVATEAPP, 1, threadidhwnd);
    857     }
     852    if(hwndOS2Win) {
     853            threadidhwnd = O32_GetWindowThreadProcessId(hwndOS2Win, &procidhwnd);
     854    }
     855
     856    if(fActivate) {
     857            SendInternalMessageA(WM_ACTIVATEAPP, 1, dwThreadId);    //activate; specify window thread id
     858    }
     859    else    SendInternalMessageA(WM_ACTIVATEAPP, 0, threadidhwnd);  //deactivate; specify thread id of other process
    858860    return rc;
    859861}
     
    10511053}
    10521054//******************************************************************************
    1053 //******************************************************************************
    1054 ULONG  Win32BaseWindow::MsgFormatFrame()
    1055 {
    1056   RECT window = rectWindow,client = rectClient,rect;
     1055//Called when either the frame's size or position has changed (lpWndPos != NULL)
     1056//or when the frame layout has changed (i.e. scrollbars added/removed) (lpWndPos == NULL)
     1057//******************************************************************************
     1058ULONG Win32BaseWindow::MsgFormatFrame(WINDOWPOS *lpWndPos)
     1059{
     1060  RECT oldWindowRect = rectWindow, client = rectClient, newWindowRect;
    10571061  WINDOWPOS wndPos;
    10581062
    1059   wndPos.hwnd = Win32Hwnd;
    1060   wndPos.hwndInsertAfter = 0;
    1061   rect = rectWindow;
    1062   if (getParent()) mapWin32Rect(OSLIB_HWND_DESKTOP,getParent()->getOS2WindowHandle(),&rect);
    1063   wndPos.x = rect.left;
    1064   wndPos.y = rect.top;
    1065   wndPos.cx = rect.right-rect.left;
    1066   wndPos.cy = rect.bottom-rect.top;
    1067   wndPos.flags = 0; //dummy
    1068 
    1069   return SendNCCalcSize(TRUE,&window,&window,&client,&wndPos,&rectClient);
     1063  if(lpWndPos) {
     1064    //set new window rectangle
     1065    setWindowRect(lpWndPos->x, lpWndPos->y, lpWndPos->x + lpWndPos->cx, lpWndPos->y + lpWndPos->cy);
     1066    newWindowRect = rectWindow;
     1067  }
     1068  else {
     1069    wndPos.hwnd  = Win32Hwnd;
     1070    wndPos.hwndInsertAfter = 0;
     1071    newWindowRect= rectWindow;
     1072    if (getParent()) mapWin32Rect(OSLIB_HWND_DESKTOP,getParent()->getOS2WindowHandle(),&newWindowRect);
     1073    wndPos.x     = newWindowRect.left;
     1074    wndPos.y     = newWindowRect.top;
     1075    wndPos.cx    = newWindowRect.right - newWindowRect.left;
     1076    wndPos.cy    = newWindowRect.bottom - newWindowRect.top;
     1077    wndPos.flags = SWP_FRAMECHANGED;
     1078    lpWndPos = &wndPos;
     1079  }
     1080
     1081  return SendNCCalcSize(TRUE, &oldWindowRect, &newWindowRect, &client, &wndPos, &rectClient);
    10701082}
    10711083//******************************************************************************
     
    25372549 ULONG         magic;
    25382550
    2539   hwndActive = OSLibWinSetActiveWindow(OS2HwndFrame);
    2540   win32wnd = (Win32BaseWindow *)OSLibWinGetWindowULong(hwndActive, OFFSET_WIN32WNDPTR);
    2541   magic    = OSLibWinGetWindowULong(hwndActive, OFFSET_WIN32PM_MAGIC);
    2542   if(CheckMagicDword(magic) && win32wnd)
    2543   {
     2551    dprintf(("SetActiveWindow %x", getWindowHandle()));
     2552    hwndActive = OSLibWinSetActiveWindow(OS2HwndFrame);
     2553    win32wnd = (Win32BaseWindow *)OSLibWinGetWindowULong(hwndActive, OFFSET_WIN32WNDPTR);
     2554    magic    = OSLibWinGetWindowULong(hwndActive, OFFSET_WIN32PM_MAGIC);
     2555    if(CheckMagicDword(magic) && win32wnd)
     2556    {
    25442557        return win32wnd->getWindowHandle();
    2545   }
    2546   return 0;
     2558    }
     2559    return windowDesktop->getWindowHandle(); //pretend the desktop was active
    25472560}
    25482561//******************************************************************************
Note: See TracChangeset for help on using the changeset viewer.