1 Commits

Author SHA1 Message Date
c4876e5606 v1.2.3: add arg to fix framebuffer not redrawing
on some devices, the framebuffer will not redraw unless something is written to stdout, so the arg 'force-stdout' has been added to write spaces to stdout after every key press or touch event
2025-11-03 00:39:59 +00:00
3 changed files with 25 additions and 3 deletions

View File

@@ -1,6 +1,6 @@
[package]
name = "ming-wm"
version = "1.2.2"
version = "1.2.3"
repository = "https://github.com/stjet/ming-wm"
license = "GPL-3.0-or-later"
edition = "2021"

View File

@@ -67,6 +67,20 @@ ming touch rotate
<image alt="mobile example" src="/docs/images/mobile.png" width="50%">
### Troubleshooting
If key presses do nothing, that is, if on the lockscreen, despite key presses (physical or of the OSK), nothing happens (no asterisk characters show up), try adding the `force-stdout` arg. For example:
```
ming force-stdout
```
Or:
```
ming touch force-stdout
```
## Philosophy
See [/docs/philosophy.md](/docs/philosophy.md) for some hopefully interesting ramblings.

View File

@@ -107,6 +107,7 @@ fn init(framebuffer: Framebuffer, framebuffer_info: FramebufferInfo) {
});
let touch = args.contains(&"touch".to_string());
let force_stdout = args.contains(&"force-stdout".to_string()); //write to stdout to force framebuffer redraw
//read touchscreen presses (hopefully)
thread::spawn(move || {
@@ -152,10 +153,17 @@ fn init(framebuffer: Framebuffer, framebuffer_info: FramebufferInfo) {
for message in rx {
match message {
ThreadMessage::KeyChar(kc) => wm.handle_message(WindowManagerMessage::KeyChar(kc.clone())),
ThreadMessage::KeyChar(kc) => {
wm.handle_message(WindowManagerMessage::KeyChar(kc.clone()));
if force_stdout {
println!(" "); //without any stdout, on some user's devices, for some reason the framebuffer doesn't get redrawn to the screen
}
},
ThreadMessage::Touch(x, y) => {
wm.handle_message(WindowManagerMessage::Touch(x, y));
if force_stdout {
println!(" "); //without any stdout, on my phone, for some reason the framebuffer doesn't get redrawn to the screen
}
},
ThreadMessage::Clear => {
write!(stdout.stdout, "{}", CLEAR_ALL).unwrap();