feat(settings): refine density, group detailed options and add edge maximize gestures

This commit is contained in:
aria committed 2026-10-28 04:49:27 +09:00
1 parent d7e122711a
commit 9908dde9f8
11 files changed
+588 -195

No files matched your search

+26 -19
View File
@@ -127,12 +127,12 @@ fn main() -> Result<(), Box<dyn Error>> {
}
hovers.push((v[0], v[1]));
}
"--click" => {
"--click" | "--double-click" => {
let v = parse_numbers(&args.next().ok_or("missing click position")?)?;
if v.len() != 2 {
return Err("invalid click".into());
}
clicks.push((v[0], v[1]));
clicks.push((v[0], v[1], if arg == "--double-click" { 2 } else { 1 }));
}
"--drag" => {
let v = parse_numbers(&args.next().ok_or("missing drag positions")?)?;
@@ -273,7 +273,7 @@ fn main() -> Result<(), Box<dyn Error>> {
queue.roundtrip(&mut state)?;
std::thread::sleep(Duration::from_millis(120));
}
for (x, y) in clicks {
for (x, y, count) in clicks {
pointer.motion_absolute(
started.elapsed().as_millis() as u32,
x,
@@ -284,22 +284,29 @@ fn main() -> Result<(), Box<dyn Error>> {
pointer.frame();
queue.roundtrip(&mut state)?;
std::thread::sleep(Duration::from_millis(80));
pointer.button(
started.elapsed().as_millis() as u32,
0x110,
wl_pointer::ButtonState::Pressed,
);
pointer.frame();
queue.roundtrip(&mut state)?;
std::thread::sleep(Duration::from_millis(80));
pointer.button(
started.elapsed().as_millis() as u32,
0x110,
wl_pointer::ButtonState::Released,
);
pointer.frame();
queue.roundtrip(&mut state)?;
std::thread::sleep(Duration::from_millis(150));
for index in 0..count {
pointer.button(
started.elapsed().as_millis() as u32,
0x110,
wl_pointer::ButtonState::Pressed,
);
pointer.frame();
queue.roundtrip(&mut state)?;
std::thread::sleep(Duration::from_millis(80));
pointer.button(
started.elapsed().as_millis() as u32,
0x110,
wl_pointer::ButtonState::Released,
);
pointer.frame();
queue.roundtrip(&mut state)?;
// Consecutive clicks must fit Iced's 300 ms double-click window.
std::thread::sleep(Duration::from_millis(if index + 1 < count {
80
} else {
150
}));
}
}
if let Some(v) = drag {
pointer.motion_absolute(