mgradwohl / mgradwohl/tasksmack
Harden borderless title-bar drag/maximize behavior on Wayland
- Dominant language
- C++
- Stars
- 1
- Forks
- 0
- Avg merge
- 3h 4m
- Merged PRs (30d)
- 115
Description
## Summary
Custom title bar drag/maximize/restore uses client-side global positioning paths that are not consistently supported on Wayland compositors.
## Why this matters
Wayland commonly restricts client-controlled global window coordinates and move/resize semantics. Current behavior can be inconsistent across compositors for drag, restore, and maximize behavior with borderless windows.
## Evidence
- `src/App/TitleBarLayer.cpp` uses `SDL_GetGlobalMouseState`, client-side drag math, `setPosition`, `setSize`.
- `src/Core/Window.cpp` borderless maximize/restore relies on explicit `SDL_SetWindowPosition` / `SDL_SetWindowSize` and saved restore geometry.
- No backend capability branch based on SDL video driver was found.
## Suggested fix
- Detect backend via `SDL_GetCurrentVideoDriver()`.
- Use Wayland-appropriate behavior paths (prefer compositor/native operations where available).
- Provide fallback setting to use native decorations on Wayland if needed.
- Add matrix tests for GNOME Wayland, KDE Wayland, and X11.
## Acceptance criteria
- Drag/maximize/restore works reliably on Wayland and X11.
- Behavior does not regress on Windows.
Contributor guide
Research direction
Start with src/App/TitleBarLayer.cpp and src/Core/Window.cpp, tracing SDL_GetGlobalMouseState, setPosition, setSize, SDL_SetWindowPosition, SDL_SetWindowSize, and the saved restore geometry. Check SDL_GetCurrentVideoDriver() behavior and available window operations before defining backend paths. Done means drag, maximize, and restore are reliable on GNOME Wayland, KDE Wayland, and X11 without regressing Windows.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- desktop, operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100