mirror of
https://github.com/feschber/lan-mouse.git
synced 2026-04-22 02:03:19 +03:00
Compare commits
3 Commits
capture-du
...
drop-hard-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b48d7127f3 | ||
|
|
1f7a7309eb | ||
|
|
8926d8f803 |
14
build.rs
14
build.rs
@@ -1,4 +1,18 @@
|
|||||||
|
use std::process::Command;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
// commit hash
|
||||||
|
let git_describe = Command::new("git")
|
||||||
|
.arg("describe")
|
||||||
|
.arg("--always")
|
||||||
|
.arg("--dirty")
|
||||||
|
.arg("--tags")
|
||||||
|
.output()
|
||||||
|
.unwrap();
|
||||||
|
|
||||||
|
let git_describe = String::from_utf8(git_describe.stdout).unwrap();
|
||||||
|
println!("cargo::rustc-env=GIT_DESCRIBE={git_describe}");
|
||||||
|
|
||||||
// composite_templates
|
// composite_templates
|
||||||
#[cfg(feature = "gtk")]
|
#[cfg(feature = "gtk")]
|
||||||
glib_build_tools::compile_resources(
|
glib_build_tools::compile_resources(
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ struct Globals {
|
|||||||
compositor: wl_compositor::WlCompositor,
|
compositor: wl_compositor::WlCompositor,
|
||||||
pointer_constraints: ZwpPointerConstraintsV1,
|
pointer_constraints: ZwpPointerConstraintsV1,
|
||||||
relative_pointer_manager: ZwpRelativePointerManagerV1,
|
relative_pointer_manager: ZwpRelativePointerManagerV1,
|
||||||
shortcut_inhibit_manager: ZwpKeyboardShortcutsInhibitManagerV1,
|
shortcut_inhibit_manager: Option<ZwpKeyboardShortcutsInhibitManagerV1>,
|
||||||
seat: wl_seat::WlSeat,
|
seat: wl_seat::WlSeat,
|
||||||
shm: wl_shm::WlShm,
|
shm: wl_shm::WlShm,
|
||||||
layer_shell: ZwlrLayerShellV1,
|
layer_shell: ZwlrLayerShellV1,
|
||||||
@@ -285,9 +285,18 @@ impl WaylandInputCapture {
|
|||||||
let relative_pointer_manager: ZwpRelativePointerManagerV1 = g
|
let relative_pointer_manager: ZwpRelativePointerManagerV1 = g
|
||||||
.bind(&qh, 1..=1, ())
|
.bind(&qh, 1..=1, ())
|
||||||
.map_err(|e| WaylandBindError::new(e, "zwp_relative_pointer_manager_v1"))?;
|
.map_err(|e| WaylandBindError::new(e, "zwp_relative_pointer_manager_v1"))?;
|
||||||
let shortcut_inhibit_manager: ZwpKeyboardShortcutsInhibitManagerV1 = g
|
let shortcut_inhibit_manager: Result<
|
||||||
|
ZwpKeyboardShortcutsInhibitManagerV1,
|
||||||
|
WaylandBindError,
|
||||||
|
> = g
|
||||||
.bind(&qh, 1..=1, ())
|
.bind(&qh, 1..=1, ())
|
||||||
.map_err(|e| WaylandBindError::new(e, "zwp_keyboard_shortcuts_inhibit_manager_v1"))?;
|
.map_err(|e| WaylandBindError::new(e, "zwp_keyboard_shortcuts_inhibit_manager_v1"));
|
||||||
|
// layer-shell backend still works without this protocol so we make it an optional dependency
|
||||||
|
if let Err(e) = &shortcut_inhibit_manager {
|
||||||
|
log::warn!("shortcut_inhibit_manager not supported: {e}\nkeybinds handled by the compositor will not be passed
|
||||||
|
to the client");
|
||||||
|
}
|
||||||
|
let shortcut_inhibit_manager = shortcut_inhibit_manager.ok();
|
||||||
let outputs = vec![];
|
let outputs = vec![];
|
||||||
|
|
||||||
let g = Globals {
|
let g = Globals {
|
||||||
@@ -424,13 +433,11 @@ impl State {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// capture modifier keys
|
// capture modifier keys
|
||||||
if self.shortcut_inhibitor.is_none() {
|
if let Some(shortcut_inhibit_manager) = &self.g.shortcut_inhibit_manager {
|
||||||
self.shortcut_inhibitor = Some(self.g.shortcut_inhibit_manager.inhibit_shortcuts(
|
if self.shortcut_inhibitor.is_none() {
|
||||||
surface,
|
self.shortcut_inhibitor =
|
||||||
&self.g.seat,
|
Some(shortcut_inhibit_manager.inhibit_shortcuts(surface, &self.g.seat, qh, ()));
|
||||||
qh,
|
}
|
||||||
(),
|
|
||||||
));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ rustPlatform.buildRustPackage {
|
|||||||
version = version;
|
version = version;
|
||||||
|
|
||||||
nativeBuildInputs = with pkgs; [
|
nativeBuildInputs = with pkgs; [
|
||||||
|
git
|
||||||
pkg-config
|
pkg-config
|
||||||
cmake
|
cmake
|
||||||
makeWrapper
|
makeWrapper
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ impl ConfigToml {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Parser, Debug)]
|
#[derive(Parser, Debug)]
|
||||||
#[command(author, version, about, long_about = None)]
|
#[command(author, version=env!("GIT_DESCRIBE"), about, long_about = None)]
|
||||||
struct CliArgs {
|
struct CliArgs {
|
||||||
/// the listen port for lan-mouse
|
/// the listen port for lan-mouse
|
||||||
#[arg(short, long)]
|
#[arg(short, long)]
|
||||||
|
|||||||
Reference in New Issue
Block a user