Skip to content

Fix window drag on Wayland#902

Open
TheCodeSharman wants to merge 1 commit intoDreamSourceLab:masterfrom
TheCodeSharman:fix-wayland-window-management
Open

Fix window drag on Wayland#902
TheCodeSharman wants to merge 1 commit intoDreamSourceLab:masterfrom
TheCodeSharman:fix-wayland-window-management

Conversation

@TheCodeSharman
Copy link
Copy Markdown

@TheCodeSharman TheCodeSharman commented Apr 12, 2026

Summary

Fixes the title bar drag issue that affects DSView when running as a native Wayland client with Qt 6+. Previously DSView ran through XWayland where this issue was hidden, but with Qt 6's improved Wayland support the app now runs natively and the problem is exposed.

  • Title bar drag broken on Wayland: The custom title bar used QWidget::move() to reposition the window, which Wayland compositors silently ignore (clients cannot set their own window position). Fixed by detecting Wayland at runtime and calling QWindow::startSystemMove() instead, which delegates the move to the compositor via the correct Wayland protocol request.

Platform

  • OS: Linux (tested on COSMIC desktop / Pop!_OS)
  • Display server: Wayland (native Qt Wayland client — not XWayland)
  • Qt version: 6.4.2

This issue does not affect Windows, macOS, or Linux users running DSView through XWayland.

Files changed

  • DSView/pv/toolbars/titlebar.cpp — added #include <QWindow> and Wayland-aware move handling in mousePressEvent

Test plan

  • Build with Qt 6 on Linux with a Wayland compositor
  • Drag the DSView window by its title bar — window should move correctly
  • Verify Super+drag still works as expected
  • Verify resizing from window edges still works
  • Verify no regression on window drag/resize behaviour when running under XWayland (WAYLAND_DISPLAY unset or QT_QPA_PLATFORM=xcb)
  • Verify no regression on Windows or macOS builds (changes are guarded by #ifndef _WIN32 and runtime Wayland detection)

@TheCodeSharman TheCodeSharman changed the title Fix window drag and taskbar icon on Wayland Fix window drag on Wayland Apr 12, 2026
On Wayland with Qt 6+, DSView runs as a native Wayland client rather
than through XWayland. The custom title bar called move() directly to
reposition the window, but Wayland compositors ignore move() calls from
clients — window position is managed exclusively by the compositor.

Fixed by detecting Wayland at runtime and calling
QWindow::startSystemMove() instead, which sends the appropriate
compositor request.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@TheCodeSharman TheCodeSharman force-pushed the fix-wayland-window-management branch from 8b53f7e to c9aeded Compare April 12, 2026 10:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant