- Timestamp:
- Nov 6, 2009, 8:08:18 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gui/kernel/qapplication_pm.cpp
r289 r301 2068 2068 } 2069 2069 2070 // Note: due to the vertical coordinate space flip in PM, WM_SIZE events may 2071 // also mean moving the widget in Qt coordinates 2072 2073 if (qmsg.msg == WM_MOVE || qmsg.msg == WM_SIZE) { // move event 2074 QPoint oldPos = data->crect.topLeft(); 2075 SWP swp; 2076 if (isWindow()) { 2077 WinQueryWindowPos(fId, &swp); 2078 // flip y coordinate 2079 swp.y = QApplication::desktop()->height() - (swp.y + swp.cy); 2080 QTLWExtra *top = d_func()->topData(); 2081 swp.x += top->frameStrut.left(); 2082 swp.y += top->frameStrut.top(); 2083 } else { 2084 WinQueryWindowPos(internalWinId(), &swp); 2085 // flip y coordinate 2086 swp.y = parentWidget()->height() - (swp.y + swp.cy); 2087 } 2088 QPoint newCPos(swp.x, swp.y); 2089 if (newCPos != oldPos) { 2090 data->crect.moveTopLeft(newCPos); 2091 if (isVisible()) { 2092 QMoveEvent e(newCPos, oldPos); // cpos (client position) 2093 QApplication::sendSpontaneousEvent(this, &e); 2094 } else { 2095 QMoveEvent *e = new QMoveEvent(newCPos, oldPos); 2096 QApplication::postEvent(this, e); 2097 } 2098 } 2099 } 2070 2100 if (qmsg.msg == WM_SIZE) { // resize event 2071 2101 QSize oldSize = data->crect.size(); … … 2127 2157 } 2128 2158 } 2129 } else if (qmsg.msg == WM_MOVE) { // move event2130 QPoint oldPos = data->crect.topLeft();2131 SWP swp;2132 if (isWindow()) {2133 WinQueryWindowPos(fId, &swp);2134 // flip y coordinate2135 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 coordinate2142 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 }2155 2159 } 2156 2160 setAttribute(Qt::WA_WState_ConfigPending, false); // clear config flag
Note:
See TracChangeset
for help on using the changeset viewer.