Changeset 7189 for trunk/src


Ignore:
Timestamp:
Oct 24, 2001, 1:21:18 PM (24 years ago)
Author:
sandervl
Message:

window tracking activation fixes

File:
1 edited

Legend:

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

    r7171 r7189  
    2222#include "win32wbase.h"
    2323#include "hook.h"
     24#include "pmwindow.h"
    2425
    2526#define ON_LEFT_BORDER(hit) \
     
    441442    DWORD     dwPoint = GetMessagePos ();
    442443    BOOL DragFullWindows = FALSE;
     444    BOOL fControl = FALSE;
    443445    BOOL grab;
    444446    int iWndsLocks;
     
    454456//    if (IsZoomed(hwnd) || !IsWindowVisible(hwnd) || (exstyle & WS_EX_MANAGED)) return;
    455457    if (IsZoomed(hwnd) || !IsWindowVisible(hwnd)) return;
     458
     459    if(fOS2Look) {
     460        fControl = GetAsyncKeyState(VK_CONTROL);
     461        if(DragFullWindows && !fControl) {
     462            //Bring window to top and activate it
     463            SetWindowPos(hwnd, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
     464        }
     465    }
    456466
    457467    if ((wParam & 0xfff0) == SC_MOVE)
     
    645655                                      newRect.right - newRect.left,
    646656                                      newRect.bottom - newRect.top,
    647                                       ( hittest == HTCAPTION ) ? SWP_NOSIZE : 0 );
     657                                      ((hittest == HTCAPTION ) ? SWP_NOSIZE : 0 ) |
     658                                      ((fControl) ? (SWP_NOACTIVATE|SWP_NOZORDER) : 0));
    648659//                        WIN_RestoreWndsLock(iWndsLocks);
    649660                    }
     
    705716                              lastsizingRect.right - lastsizingRect.left,
    706717                              lastsizingRect.bottom - lastsizingRect.top,
    707                               ( hittest == HTCAPTION ) ? SWP_NOSIZE : 0 );
     718                              ((hittest == HTCAPTION ) ? SWP_NOSIZE : 0 ) |
     719                              ((fControl) ? (SWP_NOACTIVATE|SWP_NOZORDER) : 0));
    708720        }
    709721        else
    710722        { /* restore previous size/position */
     723            //SvL: TODO: should really restore z-order & activation here
    711724            if(DragFullWindows)
    712725                SetWindowPos( hwnd, 0, origRect.left, origRect.top,
     
    718731//        WIN_RestoreWndsLock(iWndsLocks);
    719732    }
     733    else
     734    if (!((msg.message == WM_KEYDOWN) && (msg.wParam == VK_ESCAPE)) ) {
     735        //if action wasn't cancelled, ctrl wasn't pressed and we didn't
     736        //activate the window before (!DragFullWindows), then activate
     737        //and bring it to the top now
     738        if(!fControl && !DragFullWindows) {
     739            //Bring window to top and activate it
     740            SetWindowPos(hwnd, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
     741        }
     742    }
    720743
    721744    if (IsIconic(hwnd))
Note: See TracChangeset for help on using the changeset viewer.