fix un-fullscreening windows changing the coords, fix touchscreen not redrawing framebuffer
This commit is contained in:
14
README.md
14
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).
|
||||||
|
|
||||||

|

|
||||||

|

|
||||||
@@ -49,9 +49,9 @@ Usage for most of the included windows and window-likes are included in `docs/wi
|
|||||||
|
|
||||||
## Running on Mobile Linux
|
## 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
|
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.
|
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
|
## 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.
|
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!
|
Obviously, don't run the executable with `sudo` or `doas`, or as the root user!
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|||||||
@@ -118,6 +118,7 @@ fn init(framebuffer: Framebuffer, framebuffer_info: FramebufferInfo) {
|
|||||||
let mut y: Option<usize> = None;
|
let mut y: Option<usize> = None;
|
||||||
for line in reader.lines() {
|
for line in reader.lines() {
|
||||||
let line = line.unwrap();
|
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 ") {
|
if line.contains("ABS_X), value ") || line.contains("ABS_Y), value ") {
|
||||||
let value: Vec<_> = line.split("), value ").collect();
|
let value: Vec<_> = line.split("), value ").collect();
|
||||||
let value = value[value.len() - 1].parse::<usize>().unwrap();
|
let value = value[value.len() - 1].parse::<usize>().unwrap();
|
||||||
|
|||||||
@@ -24,7 +24,6 @@ use crate::essential::start_menu::StartMenu;
|
|||||||
use crate::essential::about::About;
|
use crate::essential::about::About;
|
||||||
use crate::essential::help::Help;
|
use crate::essential::help::Help;
|
||||||
use crate::essential::onscreen_keyboard::OnscreenKeyboard;
|
use crate::essential::onscreen_keyboard::OnscreenKeyboard;
|
||||||
//use crate::logging::log;
|
|
||||||
|
|
||||||
//todo: a lot of the usize should be changed to u16
|
//todo: a lot of the usize should be changed to u16
|
||||||
|
|
||||||
@@ -40,6 +39,7 @@ struct WindowLikeInfo {
|
|||||||
id: usize,
|
id: usize,
|
||||||
window_like: WindowBox,
|
window_like: WindowBox,
|
||||||
top_left: Point,
|
top_left: Point,
|
||||||
|
old_top_left: Point,
|
||||||
dimensions: Dimensions,
|
dimensions: Dimensions,
|
||||||
workspace: Workspace,
|
workspace: Workspace,
|
||||||
fullscreen: bool,
|
fullscreen: bool,
|
||||||
@@ -105,6 +105,7 @@ impl WindowManager {
|
|||||||
id,
|
id,
|
||||||
window_like,
|
window_like,
|
||||||
top_left,
|
top_left,
|
||||||
|
old_top_left: top_left,
|
||||||
dimensions,
|
dimensions,
|
||||||
workspace: if subtype == WindowLikeType::Window {
|
workspace: if subtype == WindowLikeType::Window {
|
||||||
Workspace::Workspace(self.current_workspace)
|
Workspace::Workspace(self.current_workspace)
|
||||||
@@ -458,17 +459,20 @@ impl WindowManager {
|
|||||||
let window_like = &self.window_infos[focused_index].window_like;
|
let window_like = &self.window_infos[focused_index].window_like;
|
||||||
if window_like.subtype() == WindowLikeType::Window && window_like.resizable() {
|
if window_like.subtype() == WindowLikeType::Window && window_like.resizable() {
|
||||||
//toggle fullscreen
|
//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
|
//todo: send message to window about resize
|
||||||
let new_dimensions;
|
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];
|
new_dimensions = [self.dimensions[0], self.dimensions[1] - TASKBAR_HEIGHT - INDICATOR_HEIGHT];
|
||||||
self.window_infos[focused_index].top_left = [0, INDICATOR_HEIGHT];
|
window_info.old_top_left = window_info.top_left;
|
||||||
redraw_ids = Some(vec![self.window_infos[focused_index].id]);
|
window_info.top_left = [0, INDICATOR_HEIGHT];
|
||||||
|
redraw_ids = Some(vec![window_info.id]);
|
||||||
} else {
|
} 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;
|
press_response = WindowMessageResponse::JustRedraw;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user