Ignore:
Timestamp:
Feb 1, 2010, 12:24:47 PM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

gui/kernel: Implemented delivering of QEvent::NonClientAreaMouse* events to top-level widgets (#122).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/gui/kernel/qwidget_pm.cpp

    r497 r498  
    7171extern PFNWP QtOldFrameProc;
    7272extern MRESULT EXPENTRY QtFrameProc(HWND, ULONG, MPARAM, MPARAM);
     73extern PFNWP QtOldFrameCtlProcs[FID_HORZSCROLL - FID_SYSMENU + 1];
     74extern MRESULT EXPENTRY QtFrameCtlProc(HWND, ULONG, MPARAM, MPARAM);
    7375
    7476#if !defined(QT_NO_SESSIONMANAGER)
     
    11611163                QtOldFrameProc = oldProc;
    11621164
     1165            // subclass all standard frame controls to get non-client mouse events
     1166            // (note: the size of the ctls array must match QtOldFrameCtlProcs)
     1167            HWND ctls[FID_HORZSCROLL - FID_SYSMENU + 1];
     1168            if (WinMultWindowFromIDs(fId, ctls, FID_SYSMENU, FID_HORZSCROLL) > 0) {
     1169                for (size_t i = 0; i < sizeof(ctls)/sizeof(ctls[0]); ++i) {
     1170                    if (ctls[i] != NULLHANDLE) {
     1171                        oldProc = WinSubclassWindow(ctls[i], QtFrameCtlProc);
     1172                        // remember the old proc only once: it's the same for
     1173                        // all standard frame control windows.
     1174                        if (!QtOldFrameCtlProcs[i])
     1175                            QtOldFrameCtlProcs[i] = oldProc;
     1176                    }
     1177                }
     1178            }
     1179
    11631180            removeSysMenuAccels(fId);
    11641181
Note: See TracChangeset for help on using the changeset viewer.