summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qapplication_x11.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/kernel/qapplication_x11.cpp')
-rw-r--r--src/gui/kernel/qapplication_x11.cpp31
1 files changed, 17 insertions, 14 deletions
diff --git a/src/gui/kernel/qapplication_x11.cpp b/src/gui/kernel/qapplication_x11.cpp
index fbb4920..589b12e 100644
--- a/src/gui/kernel/qapplication_x11.cpp
+++ b/src/gui/kernel/qapplication_x11.cpp
@@ -5227,14 +5227,15 @@ bool QETWidget::translateConfigEvent(const XEvent *event)
bool trust = isVisible()
&& (d->topData()->parentWinId == XNone ||
d->topData()->parentWinId == QX11Info::appRootWindow());
+ bool isCPos = false;
if (event->xconfigure.send_event || trust) {
// if a ConfigureNotify comes from a real sendevent request, we can
// trust its values.
newCPos.rx() = event->xconfigure.x + event->xconfigure.border_width;
newCPos.ry() = event->xconfigure.y + event->xconfigure.border_width;
+ isCPos = true;
}
-
if (isVisible())
QApplication::syncX();
@@ -5260,6 +5261,7 @@ bool QETWidget::translateConfigEvent(const XEvent *event)
otherEvent.xconfigure.border_width;
newCPos.ry() = otherEvent.xconfigure.y +
otherEvent.xconfigure.border_width;
+ isCPos = true;
}
}
#ifndef QT_NO_XSYNC
@@ -5272,6 +5274,19 @@ bool QETWidget::translateConfigEvent(const XEvent *event)
#endif // QT_NO_XSYNC
}
+ if (!isCPos) {
+ // we didn't get an updated position of the toplevel.
+ // either we haven't moved or there is a bug in the window manager.
+ // anyway, let's query the position to be certain.
+ int x, y;
+ Window child;
+ XTranslateCoordinates(X11->display, internalWinId(),
+ QApplication::desktop()->screen(d->xinfo.screen())->internalWinId(),
+ 0, 0, &x, &y, &child);
+ newCPos.rx() = x;
+ newCPos.ry() = y;
+ }
+
QRect cr (geometry());
if (newCPos != cr.topLeft()) { // compare with cpos (exluding frame)
QPoint oldPos = geometry().topLeft();
@@ -5314,18 +5329,6 @@ bool QETWidget::translateConfigEvent(const XEvent *event)
}
if (wasResize) {
- static bool slowResize = qgetenv("QT_SLOW_TOPLEVEL_RESIZE").toInt();
- if (d->extra->compress_events && !slowResize && !data->in_show && isVisible()) {
- QApplication::syncX();
- XEvent otherEvent;
- while (XCheckTypedWindowEvent(X11->display, internalWinId(), ConfigureNotify, &otherEvent)
- && !qt_x11EventFilter(&otherEvent) && !x11Event(&otherEvent)
- && otherEvent.xconfigure.event == otherEvent.xconfigure.window) {
- data->crect.setWidth(otherEvent.xconfigure.width);
- data->crect.setHeight(otherEvent.xconfigure.height);
- }
- }
-
if (isVisible() && data->crect.size() != oldSize) {
Q_ASSERT(d->extra->topextra);
QWidgetBackingStore *bs = d->extra->topextra->backingStore.data();
@@ -5334,7 +5337,7 @@ bool QETWidget::translateConfigEvent(const XEvent *event)
// resize optimization in order to get invalidated regions for resized widgets.
// The optimization discards all invalidateBuffer() calls since we're going to
// repaint everything anyways, but that's not the case with static contents.
- if (!slowResize && !hasStaticContents)
+ if (!hasStaticContents)
d->extra->topextra->inTopLevelResize = true;
QResizeEvent e(data->crect.size(), oldSize);
QApplication::sendSpontaneousEvent(this, &e);