Changeset 603


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).

Location:
trunk/src/gui
Files:
6 edited

Legend:

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

    r569 r603  
    433433}
    434434
     435
     436
     437
     438
     439
     440
     441
     442
     443
     444
     445
     446
     447
     448
     449
     450
     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 = 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 = 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 = qheight() - (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 = 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 = 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 = height() - (swp.y + swp.cy);
    23312349            QTLWExtra *top = d_func()->topData();
    23322350            swp.x += top->frameStrut.left();
  • trunk/src/gui/kernel/qcursor_pm.cpp

    r564 r603  
    121121    WinQueryPointerPos(HWND_DESKTOP, &p);
    122122    // flip y coordinate
    123     p.y = QApplication::desktop()->height() - (p.y + 1);
     123    p.y = height() - (p.y + 1);
    124124    return QPoint(p.x, p.y);
    125125}
     
    128128{
    129129    // flip y coordinate
    130     y = QApplication::desktop()->height() - (y + 1);
     130    y = height() - (y + 1);
    131131    WinSetPointerPos(HWND_DESKTOP, x, y);
    132132}
  • trunk/src/gui/kernel/qdnd_pm.cpp

    r580 r603  
    473473            // flip y coordinate
    474474            QPoint pnt(info->xDrop, info->yDrop);
    475             pnt.setY(QApplication::desktop()->height() - (pnt.y() + 1));
     475            pnt.setY(height() - (pnt.y() + 1));
    476476            pnt = widget->mapFromGlobal(pnt);
    477477
     
    688688            // flip y coordinate
    689689            QPoint pnt(info->xDrop, info->yDrop);
    690             pnt.setY(QApplication::desktop()->height() - (pnt.y() + 1));
     690            pnt.setY(height() - (pnt.y() + 1));
    691691            pnt = widget->mapFromGlobal(pnt);
    692692            if (dragData->lastDragOverWidget != widget)
  • trunk/src/gui/kernel/qwidget_pm.cpp

    r569 r603  
    284284    // first, process areas placed outside the screen bounds
    285285    if (flags & PWO_Screen) {
    286         RECTL rclScr = { 0, 0, QApplication::desktop()->width(),
    287                                QApplication::desktop()->height() };
     286        RECTL rclScr = { 0, 0, qt_display_width(), qt_display_height() };
    288287        WinMapWindowPoints(HWND_DESKTOP, hwnd, (PPOINTL) &rclScr, 2);
    289288        // rough check of whether some window part is outside bounds
     
    15401539    WinMapWindowPoints(internalWinId(), HWND_DESKTOP, &ptl, 1);
    15411540    // flip y (global) coordinate
    1542     ptl.y = QApplication::desktop()->height() - (ptl.y + 1);
     1541    ptl.y = height() - (ptl.y + 1);
    15431542    return QPoint(ptl.x, ptl.y);
    15441543}
     
    15571556    ptl.x = pos.x();
    15581557    // flip y (global) coordinate
    1559     ptl.y = QApplication::desktop()->height() - (pos.y() + 1);
     1558    ptl.y = height() - (pos.y() + 1);
    15601559    WinMapWindowPoints(HWND_DESKTOP, internalWinId(), &ptl, 1);
    15611560    // flip y (local) coordinate
     
    17561755                WinSetWindowPos(fId, HWND_TOP, r.left(),
    17571756                                // flip y coodrinate
    1758                                 QApplication::desktop()->height() - (r.top() + r.height()),
     1757                                height() - (r.top() + r.height()),
    17591758                                r.width(), r.height(), fl);
    17601759            } else {
     
    21172116            data.crect.setRect(x, y, w, h);
    21182117        } else if (q->isWindow()) {
    2119             int sh = QApplication::desktop()->height();
     2118            int sh = height();
    21202119            QRect fs(frameStrut());
    21212120            if (extra) {
     
    24082407    WinQueryWindowPos(data.winid, &cswp);
    24092408    // flip y coordinates
    2410     swp.y = QApplication::desktop()->height() - (swp.y + swp.cy);
     2409    swp.y = height() - (swp.y + swp.cy);
    24112410    cswp.y = swp.cy - (cswp.y + cswp.cy);
    24122411    QRect &fs = top->frameStrut;
  • trunk/src/gui/kernel/qwindowdefs_pm.h

    r580 r603  
    8383Q_GUI_EXPORT HPS qt_display_ps();
    8484
     85
     86
     87
    8588Q_GUI_EXPORT QWidget *qWidgetFromHWND(HWND hwnd);
    8689
  • trunk/src/gui/util/qsystemtrayicon_pm.cpp

    r564 r603  
    121121    RECTL rcl;
    122122    if (xstQuerySysTrayIconRect(winId(), 0, &rcl)) {
    123         int sh = QApplication::desktop()->height();
     123        int sh = height();
    124124        // flip y coordinates
    125125        rcl.yTop = sh - rcl.yTop;
     
    213213                        QPoint gpos(pMsg->ptsPointerPos.x,
    214214                                    // flip y coordinate
    215                                     QApplication::desktop()->height() -
    216                                         (pMsg->ptsPointerPos.y + 1));
     215                                    qt_display_height() - (pMsg->ptsPointerPos.y + 1));
    217216                        q->contextMenu()->popup(gpos);
    218217                        q->contextMenu()->activateWindow();
Note: See TracChangeset for help on using the changeset viewer.