diff --git a/README.md b/README.md index 85a1e04..df0ce7b 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -Ming-wm is a keyboard-based, retro-themed window manager for Linux. It is neither for Wayland or the X Window System - it writes directly to the framebuffer. Inspirations include i3, Haiku, SerenityOS, and Windows98, and it is a conceptual successor to the previous [mingde](https://github.com/stjet/mingde) and [ming-os](https://github.com/stjet/ming-os). +Ming-wm is a keyboard-based, retro-themed window manager for Linux. It is neither for Wayland or the X Window System - it writes directly to the framebuffer. Inspirations include i3, Haiku, SerenityOS, and Windows98, and it is a conceptual successor to my previous projects [ming-de](https://github.com/stjet/mingde) and [ming-os](https://github.com/stjet/ming-os). ![example 1](/docs/images/ws1.png) ![example 2](/docs/images/ws3.png) @@ -49,9 +49,9 @@ Usage for most of the included windows and window-likes are included in `docs/wi ## Running on Mobile Linux -Running with an onscreen keyboard. The framebuffer may not be redrawn to the screen without a (real) key press. The volume down button seems to work. If someone knows why this is the case, and/or how to fix this, please let me know. +More or the less the same, but includes with an onscreen keyboard for touchscreens. -`evtest` needs to be installed. Currently, the input device is assumed to be at `/dev/first-touchscreen`. +`evtest` needs to be installed. Currently, the input device is assumed to be at `/dev/input/by-path/first-touchscreen`, but this is easily editable (see `src/bin/wm.rs`). So, for touchscreen support, the user running `ming` needs to have read permissions for that `dev/input/` file. ``` ming touch @@ -73,12 +73,18 @@ See [/docs/philosophy.md](/docs/philosophy.md) for some hopefully interesting ra Windows (may be called apps in other window managers) can be developed in any language, though it is easiest to do so in Rust because the `ming-wm-lib` crate can be used. -See [koxinga](https://github.com/stjet/koxinga) or `src/bin` for examples. The `docs` directory includes a [brief introduction to writing windows](docs/system/writing_windows.md), and (incomplete) documentation on the workings of ming-wm. +The `docs` directory includes a [brief introduction to writing windows](docs/system/writing_windows.md), and (incomplete) documentation on the workings of ming-wm. + +See [koxinga](https://github.com/stjet/koxinga) or `src/bin` for examples. + +A (very poorly written, and WIP) window is being written in Lisp Scheme: [ming-flashcards](https://github.com/stjet/ming-flashcards). ## Security Make sure the permissions of `password.env` are so other users cannot read or write to it. If there is no plan to recompile, just delete it. +Understand the implications of adding the user to the `video` group. And if the permissions of a `/dev/input/` file was changed for touchscreen support, understand those implications too. + Obviously, don't run the executable with `sudo` or `doas`, or as the root user! ## License diff --git a/src/bin/wm.rs b/src/bin/wm.rs index d12c63b..e097794 100644 --- a/src/bin/wm.rs +++ b/src/bin/wm.rs @@ -118,6 +118,7 @@ fn init(framebuffer: Framebuffer, framebuffer_info: FramebufferInfo) { let mut y: Option = None; for line in reader.lines() { let line = line.unwrap(); + println!(" "); //without any stdout, on my phone, for some reason the framebuffer doesn't get redrawn to the screen if line.contains("ABS_X), value ") || line.contains("ABS_Y), value ") { let value: Vec<_> = line.split("), value ").collect(); let value = value[value.len() - 1].parse::().unwrap(); diff --git a/wm/src/window_manager.rs b/wm/src/window_manager.rs index 272d568..948e259 100644 --- a/wm/src/window_manager.rs +++ b/wm/src/window_manager.rs @@ -24,7 +24,6 @@ use crate::essential::start_menu::StartMenu; use crate::essential::about::About; use crate::essential::help::Help; use crate::essential::onscreen_keyboard::OnscreenKeyboard; -//use crate::logging::log; //todo: a lot of the usize should be changed to u16 @@ -40,6 +39,7 @@ struct WindowLikeInfo { id: usize, window_like: WindowBox, top_left: Point, + old_top_left: Point, dimensions: Dimensions, workspace: Workspace, fullscreen: bool, @@ -105,6 +105,7 @@ impl WindowManager { id, window_like, top_left, + old_top_left: top_left, dimensions, workspace: if subtype == WindowLikeType::Window { Workspace::Workspace(self.current_workspace) @@ -458,17 +459,20 @@ impl WindowManager { let window_like = &self.window_infos[focused_index].window_like; if window_like.subtype() == WindowLikeType::Window && window_like.resizable() { //toggle fullscreen - self.window_infos[focused_index].fullscreen ^= true; + let window_info = &mut self.window_infos[focused_index]; + window_info.fullscreen ^= true; //todo: send message to window about resize let new_dimensions; - if self.window_infos[focused_index].fullscreen { + if window_info.fullscreen { new_dimensions = [self.dimensions[0], self.dimensions[1] - TASKBAR_HEIGHT - INDICATOR_HEIGHT]; - self.window_infos[focused_index].top_left = [0, INDICATOR_HEIGHT]; - redraw_ids = Some(vec![self.window_infos[focused_index].id]); + window_info.old_top_left = window_info.top_left; + window_info.top_left = [0, INDICATOR_HEIGHT]; + redraw_ids = Some(vec![window_info.id]); } else { - new_dimensions = self.window_infos[focused_index].dimensions; + window_info.top_left = window_info.old_top_left; + new_dimensions = window_info.dimensions; } - self.window_infos[focused_index].window_like.handle_message(WindowMessage::ChangeDimensions([new_dimensions[0], new_dimensions[1] - WINDOW_TOP_HEIGHT])); + window_info.window_like.handle_message(WindowMessage::ChangeDimensions([new_dimensions[0], new_dimensions[1] - WINDOW_TOP_HEIGHT])); press_response = WindowMessageResponse::JustRedraw; } }