Commit 6f153552 authored by Vlad Zahorodnii's avatar Vlad Zahorodnii
Browse files

Allow calling setFrameGeometry() while the client is being resized

Currently, if some script attempts to resize a window while it's being
interactively resized, the corresponding change won't be propagated to
the X server.

The main reason for that is that we don't want to configure the frame
window, the wrapper window, and the client window twice. However, since
Xcb::Window keeps track of the last configured geometry, we can adjust
X11Client::updateServerGeometry() so it only configures windows that
have mismatching geometry.

By doing so, the setFrameGeometry() function can be called by scripts
even when the associated X11 window is being interactively resized.

Note that this bug doesn't affect Wayland windows.

BUG: 426988
parent ddb24eaf
......@@ -4284,15 +4284,18 @@ void X11Client::updateServerGeometry()
// If the client is being interactively resized, then the frame window, the wrapper window,
// and the client window have correct geometry at this point, so we don't have to configure
// them again. If the client doesn't support frame counters, always update geometry.
const bool needsGeometryUpdate = !isResize() || m_syncRequest.counter == XCB_NONE;
if (needsGeometryUpdate) {
// them again.
if (m_frame.geometry() != m_bufferGeometry) {
if (!isShade()) {
if (needsGeometryUpdate) {
m_wrapper.setGeometry(QRect(clientPos(), clientSize()));
m_client.setGeometry(QRect(QPoint(0, 0), clientSize()));
const QRect requestedWrapperGeometry(clientPos(), clientSize());
if (m_wrapper.geometry() != requestedWrapperGeometry) {
const QRect requestedClientGeometry(QPoint(0, 0), clientSize());
if (m_client.geometry() != requestedClientGeometry) {
// SELI - won't this be too expensive?
// THOMAS - yes, but gtk+ clients will not resize without ...
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment