diff options
Diffstat (limited to 'src/plugins/platforms/xcb')
-rw-r--r-- | src/plugins/platforms/xcb/qxcbwindow.cpp | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp index 4f31e066ca..b8c0e5ff73 100644 --- a/src/plugins/platforms/xcb/qxcbwindow.cpp +++ b/src/plugins/platforms/xcb/qxcbwindow.cpp @@ -1221,7 +1221,24 @@ void QXcbWindow::handleClientMessageEvent(const xcb_client_message_event_t *even void QXcbWindow::handleConfigureNotifyEvent(const xcb_configure_notify_event_t *event) { - QRect rect(event->x, event->y, event->width, event->height); + bool fromSendEvent = (event->response_type & 0x80); + QPoint pos(event->x, event->y); + if (!fromSendEvent) { + // Do not trust the position, query it instead. + xcb_translate_coordinates_cookie_t cookie = xcb_translate_coordinates(xcb_connection(), xcb_window(), + m_screen->root(), 0, 0); + xcb_generic_error_t *error; + xcb_translate_coordinates_reply_t *reply = xcb_translate_coordinates_reply(xcb_connection(), cookie, &error); + if (reply) { + pos.setX(reply->dst_x); + pos.setY(reply->dst_y); + free(reply); + } else if (error) { + free(error); + } + } + + QRect rect(pos, QSize(event->width, event->height)); QPlatformWindow::setGeometry(rect); QWindowSystemInterface::handleGeometryChange(window(), rect); |