Fix window drag on Wayland#902
Open
TheCodeSharman wants to merge 1 commit into
Open
Conversation
8b53f7e to
c9aeded
Compare
The custom title bar called QWidget::move() to reposition the window.
This fails on both:
- Native Wayland: clients cannot set their own window position;
the compositor silently ignores move() requests.
- XWayland: although XWayland accepts the X11 move call, the Wayland
compositor underneath still ignores client-driven positioning, so
the behaviour is identical to native Wayland.
Fixed by calling QWindow::startSystemMove() instead, which delegates
the move to the system. On Wayland it sends xdg_toplevel.move; on X11
it sends _NET_WM_MOVERESIZE — both honoured by all modern compositors
and window managers. A single code path now handles native Wayland,
XWayland, and traditional X11 sessions.
A null check on windowHandle() guards the rare case where the window
hasn't been realised yet.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
c9aeded to
5664a8f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the title bar drag issue that affects DSView when running on any Wayland desktop, both as a native Qt Wayland client and via XWayland.
QWidget::move()to reposition the window. Wayland compositors silently ignore client-driven position changes, and this restriction is enforced even through the XWayland translation layer — so the bug affects both Qt-native and Qt-xcb modes. Fixed by callingQWindow::startSystemMove()instead, which delegates the move to the system viaxdg_toplevel.move(Wayland) or_NET_WM_MOVERESIZE(X11). A single code path now handles native Wayland, XWayland, and traditional X11 sessions.A null check on
windowHandle()guards the rare case where the window hasn't been realised yet.Platform
Changes do not affect Windows or macOS builds (guarded by
#ifndef _WIN32). Traditional X11 sessions also pick up the fix correctly via_NET_WM_MOVERESIZE.Files changed
DSView/pv/toolbars/titlebar.cpp— added#include <QWindow>and replaced the brokenmove()-based drag withQWindow::startSystemMove()inmousePressEventTest plan
QT_QPA_PLATFORM=wayland) — worksQT_QPA_PLATFORM=xcbin a Wayland session) — works#ifndef _WIN32)🤖 Generated with Claude Code