Ignore:
Timestamp:
Feb 25, 2010, 4:31:14 AM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

gui: Fixed assertion at #1125 in qwidget.cpp (due to an attempt to re-instantiate QDesktopWidget during application termination).

File:
1 edited

Legend:

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

    r569 r603  
    433433}
    434434
     435Q_GUI_EXPORT int qt_display_width()
     436{
     437    // display resolution is constant for any given bootup
     438    static LONG displayWidth = 0;
     439    if (displayWidth == 0)
     440        displayWidth = WinQuerySysValue(HWND_DESKTOP, SV_CXSCREEN);
     441    return displayWidth;
     442}
     443
     444Q_GUI_EXPORT int qt_display_height()
     445{
     446    // display resolution is constant for any given bootup
     447    static LONG displayHeight = 0;
     448    if (displayHeight == 0)
     449        displayHeight = WinQuerySysValue(HWND_DESKTOP, SV_CYSCREEN);
     450    return displayHeight;
     451}
     452
    435453// application no-grab option
    436454bool qt_nograb()
     
    676694{
    677695    // flip y coordinate
    678     int y = desktop()->height() - (pos.y() + 1);
     696    int y = qt_display_height() - (pos.y() + 1);
    679697    POINTL ptl = { pos.x(), y };
    680698    HWND hwnd = WinWindowFromPoint(HWND_DESKTOP, &ptl, FALSE);
     
    753771        }
    754772        // flip y coordinate
    755         ptl.y = QApplication::desktop()->height() - (ptl.y + 1);
     773        ptl.y = qt_display_height() - (ptl.y + 1);
    756774    }
    757775
     
    15511569    WinQueryPointerPos(HWND_DESKTOP, &curPos);
    15521570    // flip y coordinate
    1553     curPos.y = q_func()->desktop()->height() - (curPos.y + 1);
     1571    curPos.y = qt_display_height() - (curPos.y + 1);
    15541572
    15551573    if (QApplicationPrivate::popupWidgets->isEmpty()) {
     
    19982016                POINTL ptl = gpos;
    19992017                // flip y coordinate
    2000                 ptl.y = QApplication::desktop()->height() - (ptl.y + 1);
     2018                ptl.y = qt_display_height() - (ptl.y + 1);
    20012019                WinMapWindowPoints(HWND_DESKTOP, hwndTarget, &ptl, 1);
    20022020                WinPostMsg(hwndTarget, qmsg.msg,
     
    20992117    // get a confusing behavior (too many lines scrolled etc.).
    21002118    {
    2101         int devh = QApplication::desktop()->height();
     2119        int devh = qt_display_height();
    21022120        QMSG wheelMsg;
    21032121        while (WinPeekMsg(0, &wheelMsg, qmsg.hwnd, qmsg.msg, qmsg.msg, PM_NOREMOVE)) {
     
    23282346            WinQueryWindowPos(fId, &swp);
    23292347            // flip y coordinate
    2330             swp.y = QApplication::desktop()->height() - (swp.y + swp.cy);
     2348            swp.y = qt_display_height() - (swp.y + swp.cy);
    23312349            QTLWExtra *top = d_func()->topData();
    23322350            swp.x += top->frameStrut.left();
Note: See TracChangeset for help on using the changeset viewer.