Commit d7fec54b authored by Romain Vimont's avatar Romain Vimont Committed by Hugo Beauzée-Luyssen

qt: prevent window jumps on resize (X11)

On X11 with Qt < 5.10, a resize request invoked XMoveResizeWindow() (see
0285ba4e), which both moves and resizes.
To avoid moving, it was called with the current geometry() coordinates
as position arguments.

However, the calculated position may be wrong when several displays have
a different devicePixelRatio(). As a consequence, on a secondary
display, every (automatic) resize of the window made it jump to
unexpected locations.

To avoid the problem, just call XResizeWindow(), so that the window is
not moved at all.
Signed-off-by: default avatarHugo Beauzée-Luyssen <hugo@beauzee.fr>
parent eb7f8b0f
......@@ -1352,9 +1352,8 @@ void MainInterface::resizeWindow(int w, int h)
* By calling XMoveResizeWindow directly, Qt will not see our change
* request until the ConfigureNotify event on success
* and not at all if it is rejected. */
XMoveResizeWindow( QX11Info::display(), winId(),
geometry().x() * dpr, geometry().y() * dpr,
(unsigned int)size.width() * dpr, (unsigned int)size.height() * dpr);
XResizeWindow( QX11Info::display(), winId(),
(unsigned int)size.width() * dpr, (unsigned int)size.height() * dpr);
return;
}
#endif
......
Markdown is supported
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