diff options
| author | salmonik <salmonik@tuta.io> | 2026-08-17 19:08:47 +0200 |
|---|---|---|
| committer | salmonik <salmonik@tuta.io> | 2026-08-17 19:08:47 +0200 |
| commit | f4fab5a2b06c37df08d2d315bcb44d15af1786a4 (patch) | |
| tree | 725fbdefb64fdd987ead8ea2240269c1ba29bcfc /rsnix/src/gop.rs | |
| parent | wm: title-bar drag-to-move; stop delivering title-bar gestures to apps (diff) | |
| download | rs-dos-f4fab5a2b06c37df08d2d315bcb44d15af1786a4.tar.gz rs-dos-f4fab5a2b06c37df08d2d315bcb44d15af1786a4.zip | |
wm: keep windows in place when the console scrolls beneath them
The console's batched scroll (gop::shift_up_n) shifts the whole shared
shadow, which dragged any composited window pixels up with it. Add a
scroll hook so the window manager re-composites every visible window
after a console scroll, restoring them at their fixed positions.
Diffstat (limited to '')
| -rw-r--r-- | rsnix/src/gop.rs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/rsnix/src/gop.rs b/rsnix/src/gop.rs index deff226..cddad22 100644 --- a/rsnix/src/gop.rs +++ b/rsnix/src/gop.rs | |||
| @@ -104,6 +104,25 @@ pub fn qr_locked() -> bool { | |||
| 104 | QR_LOCKED.load(Ordering::Relaxed) | 104 | QR_LOCKED.load(Ordering::Relaxed) |
| 105 | } | 105 | } |
| 106 | 106 | ||
| 107 | /// Hook invoked after the console scrolls, so the window manager can | ||
| 108 | /// re-composite GUI windows (which sit above the console layer in the | ||
| 109 | /// shadow and must not scroll with it). | ||
| 110 | fn scroll_hook_noop() {} | ||
| 111 | |||
| 112 | static mut SCROLL_HOOK: fn() = scroll_hook_noop; | ||
| 113 | |||
| 114 | pub fn set_scroll_hook(f: fn()) { | ||
| 115 | unsafe { | ||
| 116 | SCROLL_HOOK = f; | ||
| 117 | } | ||
| 118 | } | ||
| 119 | |||
| 120 | pub(crate) fn call_scroll_hook() { | ||
| 121 | unsafe { | ||
| 122 | SCROLL_HOOK(); | ||
| 123 | } | ||
| 124 | } | ||
| 125 | |||
| 107 | #[inline] | 126 | #[inline] |
| 108 | fn stall_display() { | 127 | fn stall_display() { |
| 109 | let n = DISPLAY_STALL.load(Ordering::Relaxed); | 128 | let n = DISPLAY_STALL.load(Ordering::Relaxed); |
