Force xcb platform on Wayland to fix tab drag indicators#1041
Open
aniro wants to merge 1 commit intodail8859:masterfrom
Open
Force xcb platform on Wayland to fix tab drag indicators#1041aniro wants to merge 1 commit intodail8859:masterfrom
aniro wants to merge 1 commit intodail8859:masterfrom
Conversation
Qt Advanced Docking System positions its drop-indicator overlays as top-level Qt::Tool windows using mapToGlobal() + move() to absolute global coordinates. Wayland does not let clients position top-level windows, so during a tab drag the indicators appear at wrong locations. ADS upstream has documented this limitation and recommends running through XWayland. Set QT_QPA_PLATFORM=xcb;wayland on Linux Wayland sessions so the app runs through XWayland where the positioning works correctly. The semicolon-separated form falls back to wayland on systems without xcb. Honor an explicit user-set QT_QPA_PLATFORM, and provide NOTEPADNEXT_FORCE_NATIVE_WAYLAND=1 as an opt-out.
Author
Owner
|
So if I understand this correctly:
CC: @Twig6943 |
Contributor
|
@aniro howd u get dark theme?. |
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
Qt Advanced Docking System positions its drop-indicator overlays (the cross of split-direction buttons and the highlighted preview rectangles) as top-level
Qt::Toolwindows usingmapToGlobal()+move()to absolute global coordinates. Wayland does not let clients position top-level windows, so during a tab drag the indicators appear at wrong locations across the screen, making the dock UX effectively unusable on Wayland.ADS upstream has documented this limitation and officially recommends running through XWayland. The newer ADS releases (4.5.0) still don't fix it.
This PR sets
QT_QPA_PLATFORM=xcb;waylandon Linux Wayland sessions inmain.cppbefore constructingQApplication, so the app runs through XWayland where the positioning works correctly. The semicolon-separated form is Qt 6 syntax for a fallback list: Qt tries xcb first and falls back to wayland on systems where the xcb plugin is unavailable, so it stays safe on minimal containers.The override only kicks in when:
QT_QPA_PLATFORMis not already set by the user (their explicit choice always wins), andNOTEPADNEXT_FORCE_NATIVE_WAYLANDis not set.The Wayland platform plugin is still bundled with the AppImage (added in #1022), so users who set
NOTEPADNEXT_FORCE_NATIVE_WAYLAND=1still get a working app, just with the original misaligned indicators during tab drags.Test plan
NOTEPADNEXT_FORCE_NATIVE_WAYLAND=1 ./NotepadNextreproduces the original misalignment, confirming the escape hatch works.QT_QPA_PLATFORM=wayland ./NotepadNexthonors the explicit user setting.XDG_SESSION_TYPE=wayland/WAYLAND_DISPLAY).#ifdef Q_OS_LINUX).