Commit 1915c484 authored by Vlad Zahorodnii's avatar Vlad Zahorodnii

Compute correct position of drag button press on X11

Summary:
While dimensions of QScreen are in logical pixels, the origin is not.
As result, computed native coordinates are incorrect on high dpi.

Test Plan:
Drag a window by empty area on a multiple monitor setup (with High DPI),
neither cursor nor windows should "jump."

Reviewers: #plasma, davidedmundson

Reviewed By: #plasma, davidedmundson

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D20182
parent 4a60ea08
......@@ -62,6 +62,7 @@
#include <QMenuBar>
#include <QMouseEvent>
#include <QProgressBar>
#include <QScreen>
#include <QScrollBar>
#include <QStatusBar>
#include <QStyle>
......@@ -906,11 +907,12 @@ namespace Breeze
auto net_connection = connection;
#endif
const QPoint origin = window->screen()->geometry().topLeft();
const QPoint native = (position - origin) * dpiRatio + origin;
xcb_ungrab_pointer( connection, XCB_TIME_CURRENT_TIME );
NETRootInfo( net_connection, NET::WMMoveResize ).moveResizeRequest(
window->winId(), position.x() * dpiRatio,
position.y() * dpiRatio,
NET::Move );
window->winId(), native.x(), native.y(), NET::Move );
#else
......
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