summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTang Haixiang <tanghaixiang@uniontech.com>2022-04-15 13:32:21 +0800
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2022-04-20 08:32:42 +0000
commit94981ddd1e148db9b6130181543c8113e21e0721 (patch)
tree7331c3ba10c544e18a32fd83623ca8e95714aacd
parent93a026432afafbbbe8f2a93bb7c4d63eb003e182 (diff)
downloadqtwayland-94981ddd1e148db9b6130181543c8113e21e0721.tar.gz
Use QPlatformWindow's API as much as possible in QPA
When using highdpi, window->geometry != platformwindow->geometry. In QPA we should use QPlatformWindow's API. Fixes: QTBUG-102601 Change-Id: Ib4ff2edbc045cf441cd2d594d502875417eb4917 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
-rw-r--r--src/client/qwaylandinputdevice.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/client/qwaylandinputdevice.cpp b/src/client/qwaylandinputdevice.cpp
index 0cd42c1d..9566965b 100644
--- a/src/client/qwaylandinputdevice.cpp
+++ b/src/client/qwaylandinputdevice.cpp
@@ -717,7 +717,7 @@ void QWaylandInputDevice::Pointer::pointer_enter(uint32_t serial, struct wl_surf
connect(mFocus.data(), &QObject::destroyed, this, &Pointer::handleFocusDestroyed);
mSurfacePos = QPointF(wl_fixed_to_double(sx), wl_fixed_to_double(sy));
- mGlobalPos = window->window()->mapToGlobal(mSurfacePos.toPoint());
+ mGlobalPos = window->mapToGlobal(mSurfacePos.toPoint());
mParent->mSerial = serial;
mEnterSerial = serial;
@@ -783,7 +783,7 @@ void QWaylandInputDevice::Pointer::pointer_motion(uint32_t time, wl_fixed_t surf
QPointF pos(wl_fixed_to_double(surface_x), wl_fixed_to_double(surface_y));
QPointF delta = pos - pos.toPoint();
- QPointF global = window->window()->mapToGlobal(pos.toPoint());
+ QPointF global = window->mapToGlobal(pos.toPoint());
global += delta;
mSurfacePos = pos;
@@ -795,7 +795,7 @@ void QWaylandInputDevice::Pointer::pointer_motion(uint32_t time, wl_fixed_t surf
// We can't know the true position since we're getting events for another surface,
// so we just set it outside of the window boundaries.
pos = QPointF(-1, -1);
- global = grab->window()->mapToGlobal(pos.toPoint());
+ global = grab->mapToGlobal(pos.toPoint());
window = grab;
}
setFrameEvent(new MotionEvent(window, time, pos, global, mButtons, mParent->modifiers()));
@@ -875,7 +875,7 @@ void QWaylandInputDevice::Pointer::pointer_button(uint32_t serial, uint32_t time
QPointF global = mGlobalPos;
if (grab && grab != focusWindow()) {
pos = QPointF(-1, -1);
- global = grab->window()->mapToGlobal(pos.toPoint());
+ global = grab->mapToGlobal(pos.toPoint());
window = grab;
}
@@ -1487,7 +1487,7 @@ void QWaylandInputDevice::handleTouchPoint(int id, QEventPoint::State state, con
// TODO: This doesn't account for high dpi scaling for the delta, but at least it matches
// what we have for mouse input.
QPointF delta = localPosition - localPosition.toPoint();
- QPointF globalPosition = win->window()->mapToGlobal(localPosition.toPoint()) + delta;
+ QPointF globalPosition = win->mapToGlobal(localPosition.toPoint()) + delta;
tp.area.moveCenter(globalPosition);
}