Changeset 301 for trunk/src


Ignore:
Timestamp:
Nov 6, 2009, 8:08:18 PM (16 years ago)
Author:
Dmitry A. Kuminov
Message:

gui: Fixed: Due to the vertical PM coordinate space flip comparing to the Qt coordinate space, WM_SIZE events from PM may also mean widget movement. These move events were not reported to Qt which resulted widget positions from the Qt point of view not matching the actual positions on screen (#90).

File:
1 edited

Legend:

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

    r289 r301  
    20682068    }
    20692069
     2070
     2071
     2072
     2073
     2074
     2075
     2076
     2077
     2078
     2079
     2080
     2081
     2082
     2083
     2084
     2085
     2086
     2087
     2088
     2089
     2090
     2091
     2092
     2093
     2094
     2095
     2096
     2097
     2098
     2099
    20702100    if (qmsg.msg == WM_SIZE) { // resize event
    20712101        QSize oldSize = data->crect.size();
     
    21272157            }
    21282158        }
    2129     } else if (qmsg.msg == WM_MOVE) { // move event
    2130         QPoint oldPos = data->crect.topLeft();
    2131         SWP swp;
    2132         if (isWindow()) {
    2133             WinQueryWindowPos(fId, &swp);
    2134             // flip y coordinate
    2135             swp.y = QApplication::desktop()->height() - (swp.y + swp.cy);
    2136             QTLWExtra *top = d_func()->topData();
    2137             swp.x += top->frameStrut.left();
    2138             swp.y += top->frameStrut.top();
    2139         } else {
    2140             WinQueryWindowPos(internalWinId(), &swp);
    2141             // flip y coordinate
    2142             swp.y = parentWidget()->height() - (swp.y + swp.cy);
    2143         }
    2144         QPoint newCPos(swp.x, swp.y);
    2145         if (newCPos != oldPos) {
    2146             data->crect.moveTopLeft(newCPos);
    2147             if (isVisible()) {
    2148                 QMoveEvent e(newCPos, oldPos); // cpos (client position)
    2149                 QApplication::sendSpontaneousEvent(this, &e);
    2150             } else {
    2151                 QMoveEvent *e = new QMoveEvent(newCPos, oldPos);
    2152                 QApplication::postEvent(this, e);
    2153             }
    2154         }
    21552159    }
    21562160    setAttribute(Qt::WA_WState_ConfigPending, false);                // clear config flag
Note: See TracChangeset for help on using the changeset viewer.