diff --git a/Cargo.toml b/Cargo.toml index e3339f8..aeb40c7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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" diff --git a/README.md b/README.md index 4e1b35c..4299d93 100644 --- a/README.md +++ b/README.md @@ -67,6 +67,20 @@ ming touch rotate mobile example +### 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. diff --git a/src/bin/wm.rs b/src/bin/wm.rs index 88f0a92..5d313f5 100644 --- a/src/bin/wm.rs +++ b/src/bin/wm.rs @@ -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)); - println!(" "); //without any stdout, on my phone, for some reason the framebuffer doesn't get redrawn to the screen + 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();