diff options
| author | srdusr <[email protected]> | 2026-05-11 16:44:00 +0200 |
|---|---|---|
| committer | srdusr <[email protected]> | 2026-05-11 16:44:00 +0200 |
| commit | caec1e7c355bbe6437afe87cd3dab6b64fb91e0a (patch) | |
| tree | 5ecab25d2ebc36949ac4129b35e35334a575d563 /crates/wayland/src/udev/render.rs | |
| parent | baabd91411dacd179c690f724b6cbfe6270cb131 (diff) | |
| download | srdwm-caec1e7c355bbe6437afe87cd3dab6b64fb91e0a.tar.gz srdwm-caec1e7c355bbe6437afe87cd3dab6b64fb91e0a.zip | |
Three live bug reports after a restart: icon drag, lock cursor, lock box
All three reported directly after the owner restarted into today's build.
Desktop icons could not be dragged at all in single-click mode. The press
handler opened the icon immediately when general.desktop_icon_single_click
was on, so the branch that starts a drag was unreachable and an icon could
never be moved. Deciding activation on press cannot distinguish a click from
the first instant of a drag. Every press on an icon now starts a potential
drag and release decides which it was, using a 4px movement threshold that
latches once exceeded. Double-click mode goes through the same path, so both
modes now drag identically.
The lock screen drew no cursor. The cursor push in the udev render loop sits
inside `if !locked`, and a locked head renders only the lock element list, so
nothing drew a pointer - and on a bare TTY nothing else does. The on-screen
keyboard's clicks were being handled correctly the whole time
(native_lock_click); they simply could not be aimed. The pointer is now
prepended to the lock element list, above the UI it is used to click.
The password field's opaque panel is gone. New LockConfig::box_opacity,
default 0.0: no fill, no border, no rounded rectangle, just the dots and
status text over the blurred background. Raising it restores the panel at
that opacity for anyone who wants a solid field. Drawing text on a
transparent surface needed a new blit_glyph_over: the existing blit_glyph
blends against one flat opaque colour and writes alpha 255, which would have
turned every glyph into a block of the assumed background - the same box
with its middle removed.
VERIFICATION STATUS, stated plainly: all three are code-complete and the
suite passes, but none is confirmed on screen. The nested backend's capture
pass does not draw the desktop icon grid (a gap already recorded in
winit/capture.rs), so the icon drag cannot be checked by screenshot there,
and aiming blind is what this project's own rules forbid. The two lock
changes were not visually checked either.
515 tests pass, clippy clean.
Diffstat (limited to 'crates/wayland/src/udev/render.rs')
| -rw-r--r-- | crates/wayland/src/udev/render.rs | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/crates/wayland/src/udev/render.rs b/crates/wayland/src/udev/render.rs index 4170f47..aa05529 100644 --- a/crates/wayland/src/udev/render.rs +++ b/crates/wayland/src/udev/render.rs @@ -1145,6 +1145,24 @@ impl CompState { Vec::new() }; + // The pointer, on a locked head too. A locked head renders only + // the lock element list below, and the cursor push further up + // is inside `if !locked`, so a locked screen had no pointer + // drawn at all - and on a bare TTY nothing else draws one. + // The on-screen keyboard's clicks were being handled correctly + // the whole time (`native_lock_click`); they simply could not + // be aimed. Reported live as "there is no mouse input to + // interact with the screen keyboard in lockscreen". + // + // Built here rather than reusing `custom_elements` because that + // list is assembled inside the same `if !locked` branch. First + // in the list, so it stays above the lock UI it is used to + // click on. + let locked_cursor: Vec<crate::elements::OverlayElement<PixmanRenderer>> = if locked { + crate::cursor::render_elements(&cursor_status, &cursor_buffers, &mut udev.renderer, udev.pointer_pos, origin, udev.heads[index].size) + } else { + Vec::new() + }; let head = &mut udev.heads[index]; let mut framebuffer = match udev.renderer.bind(&mut head.buffers[back].image) { Ok(fb) => fb, @@ -1161,13 +1179,17 @@ impl CompState { // external locker's surface the same way, and nothing else; // unlocked heads draw the normal scene. let result = if locked && is_native { + let mut elements = locked_cursor; + elements.extend(native_elements.into_iter().map(crate::elements::OverlayElement::Memory)); head.damage_tracker - .render_output(&mut udev.renderer, &mut framebuffer, 0, &native_elements, [0.0, 0.0, 0.0, 1.0]) + .render_output(&mut udev.renderer, &mut framebuffer, 0, &elements, [0.0, 0.0, 0.0, 1.0]) .map(|r| (r.damage.is_some(), Vec::new())) .map_err(|e| e.to_string()) } else if locked { + let mut elements = locked_cursor; + elements.extend(lock_elements.into_iter().map(crate::elements::OverlayElement::Surface)); head.damage_tracker - .render_output(&mut udev.renderer, &mut framebuffer, 0, &lock_elements, [0.0, 0.0, 0.0, 1.0]) + .render_output(&mut udev.renderer, &mut framebuffer, 0, &elements, [0.0, 0.0, 0.0, 1.0]) .map(|r| (r.damage.is_some(), Vec::new())) .map_err(|e| e.to_string()) } else { |