rust-windowing / rust-windowing/winit
X11: Missing Moved event when window manager moves+resizes window together
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 6.2k
- Forks
- 1.3k
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 9
Description
Description
On KDE Plasma (X11), when the window manager moves and resizes a window via keyboard shortcuts (Meta+Arrow snap/tile), winit emits SurfaceResized but not Moved, even though the window position changed.
This may affect other X11 window managers that send real (non-synthetic) ConfigureNotify events for move+resize operations. Per ICCCM, WMs should send synthetic ConfigureNotify, but KDE appears to send real ones for keyboard snap operations.
Reproduction
git clone https://github.com/natepiano/winit.git
cd winit
WAYLAND_DISPLAY= cargo run --example x11_missing_move_on_resize
- Use keyboard snap (KDE: Meta+Arrow)
- Bug is detected: SurfaceResized fires but Moved does not
Expected Behavior
Moved event should be emitted when the window position changes.
Actual Behavior
Moved is only emitted for synthetic ConfigureNotify events. Real ConfigureNotify events never emit Moved.
Root Cause
In winit-x11/src/event_processor.rs, the configure_notify handler (~line 611-626):
let moved = if is_synthetic {
util::maybe_change(&mut shared_state_lock.inner_position, new_inner_position)
} else {
// ...
false // Real events never emit Moved
};
Suggested Fix
For real ConfigureNotify events, query the root-relative position using translate_coords_root() (which outer_position() already uses), compare against the cached position, and emit Moved if it changed.
Workaround
Query window.outer_position() after SurfaceResized events.
OS and window mananger
- OS: Asahi Linux (Fedora 42) on Apple Silicon
- Window Manager: KDE Plasma (X11 via XWayland)
Winit version
0.31.0-beta.2
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in winit-x11/src/event_processor.rs at the configure_notify handler around lines 611–626, then inspect outer_position() and translate_coords_root(). Reproduce with examples/x11_missing_move_on_resize on KDE X11 and verify that a move+resize ConfigureNotify emits both SurfaceResized and Moved when the root-relative position changes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- linux, rust
- Domain
- desktop, operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100