mirror of
https://github.com/feschber/lan-mouse.git
synced 2026-06-29 17:44:57 +03:00
Compare commits
6 Commits
main-a4259
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
392af44cbe | ||
|
|
133e1ae81d | ||
|
|
6fb7e24746 | ||
|
|
d1f41180e3 | ||
|
|
497a1a081a | ||
|
|
5342b475ae |
28
.github/workflows/release.yml
vendored
28
.github/workflows/release.yml
vendored
@@ -30,11 +30,19 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
cargo build --release
|
cargo build --release
|
||||||
cp target/release/lan-mouse lan-mouse-linux-x86_64
|
cp target/release/lan-mouse lan-mouse-linux-x86_64
|
||||||
|
- name: Install cargo bundle
|
||||||
|
run: cargo install cargo-bundle
|
||||||
|
- name: Bundle
|
||||||
|
run: |
|
||||||
|
cargo bundle --release
|
||||||
- name: Upload build artifact
|
- name: Upload build artifact
|
||||||
uses: actions/upload-artifact@v6
|
uses: actions/upload-artifact@v6
|
||||||
with:
|
with:
|
||||||
name: lan-mouse-linux-x86_64
|
name: lan-mouse-linux-x86_64
|
||||||
path: lan-mouse-linux-x86_64
|
path: |
|
||||||
|
lan-mouse-linux-x86_64
|
||||||
|
target/release/bundle/deb/lan-mouse_*.deb
|
||||||
|
target/release/bundle/appimage/lan-mouse_*.AppImage
|
||||||
|
|
||||||
linux-arm64-release-build:
|
linux-arm64-release-build:
|
||||||
runs-on: ubuntu-22.04-arm
|
runs-on: ubuntu-22.04-arm
|
||||||
@@ -49,11 +57,19 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
cargo build --release
|
cargo build --release
|
||||||
cp target/release/lan-mouse lan-mouse-linux-arm64
|
cp target/release/lan-mouse lan-mouse-linux-arm64
|
||||||
|
- name: Install cargo bundle
|
||||||
|
run: cargo install cargo-bundle
|
||||||
|
- name: Bundle
|
||||||
|
run: |
|
||||||
|
cargo bundle --release
|
||||||
- name: Upload build artifact
|
- name: Upload build artifact
|
||||||
uses: actions/upload-artifact@v6
|
uses: actions/upload-artifact@v6
|
||||||
with:
|
with:
|
||||||
name: lan-mouse-linux-arm64
|
name: lan-mouse-linux-arm64
|
||||||
path: lan-mouse-linux-arm64
|
path: |
|
||||||
|
lan-mouse-linux-arm64
|
||||||
|
target/release/bundle/deb/lan-mouse_*.deb
|
||||||
|
target/release/bundle/appimage/lan-mouse_*.AppImage
|
||||||
|
|
||||||
windows-release-build:
|
windows-release-build:
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
@@ -188,7 +204,11 @@ jobs:
|
|||||||
generate_release_notes: true
|
generate_release_notes: true
|
||||||
files: |
|
files: |
|
||||||
lan-mouse-linux-x86_64/lan-mouse-linux-x86_64
|
lan-mouse-linux-x86_64/lan-mouse-linux-x86_64
|
||||||
|
lan-mouse-linux-x86_64/target/release/bundle/deb/lan-mouse_*.deb
|
||||||
|
lan-mouse-linux-x86_64/target/release/bundle/appimage/lan-mouse_*.AppImage
|
||||||
lan-mouse-linux-arm64/lan-mouse-linux-arm64
|
lan-mouse-linux-arm64/lan-mouse-linux-arm64
|
||||||
|
lan-mouse-linux-arm64/target/release/bundle/deb/lan-mouse_*.deb
|
||||||
|
lan-mouse-linux-arm64/target/release/bundle/appimage/lan-mouse_*.AppImage
|
||||||
lan-mouse-macos-intel/lan-mouse-macos-intel.zip
|
lan-mouse-macos-intel/lan-mouse-macos-intel.zip
|
||||||
lan-mouse-macos-arm64/lan-mouse-macos-arm64.zip
|
lan-mouse-macos-arm64/lan-mouse-macos-arm64.zip
|
||||||
lan-mouse-windows-x86_64/lan-mouse-windows-x86_64.zip
|
lan-mouse-windows-x86_64/lan-mouse-windows-x86_64.zip
|
||||||
@@ -201,7 +221,11 @@ jobs:
|
|||||||
generate_release_notes: true
|
generate_release_notes: true
|
||||||
files: |
|
files: |
|
||||||
lan-mouse-linux-x86_64/lan-mouse-linux-x86_64
|
lan-mouse-linux-x86_64/lan-mouse-linux-x86_64
|
||||||
|
lan-mouse-linux-x86_64/target/release/bundle/deb/lan-mouse_*.deb
|
||||||
|
lan-mouse-linux-x86_64/target/release/bundle/appimage/lan-mouse_*.AppImage
|
||||||
lan-mouse-linux-arm64/lan-mouse-linux-arm64
|
lan-mouse-linux-arm64/lan-mouse-linux-arm64
|
||||||
|
lan-mouse-linux-arm64/target/release/bundle/deb/lan-mouse_*.deb
|
||||||
|
lan-mouse-linux-arm64/target/release/bundle/appimage/lan-mouse_*.AppImage
|
||||||
lan-mouse-macos-intel/lan-mouse-macos-intel.zip
|
lan-mouse-macos-intel/lan-mouse-macos-intel.zip
|
||||||
lan-mouse-macos-arm64/lan-mouse-macos-arm64.zip
|
lan-mouse-macos-arm64/lan-mouse-macos-arm64.zip
|
||||||
lan-mouse-windows-x86_64/lan-mouse-windows-x86_64.zip
|
lan-mouse-windows-x86_64/lan-mouse-windows-x86_64.zip
|
||||||
|
|||||||
8
.github/workflows/rust.yml
vendored
8
.github/workflows/rust.yml
vendored
@@ -40,7 +40,6 @@ jobs:
|
|||||||
- test
|
- test
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v6
|
||||||
- uses: Swatinem/rust-cache@v2
|
|
||||||
- name: Install Linux deps
|
- name: Install Linux deps
|
||||||
if: runner.os == 'Linux'
|
if: runner.os == 'Linux'
|
||||||
run: |
|
run: |
|
||||||
@@ -49,6 +48,13 @@ jobs:
|
|||||||
- name: Install macOS dependencies
|
- name: Install macOS dependencies
|
||||||
if: runner.os == 'macOS'
|
if: runner.os == 'macOS'
|
||||||
run: brew install gtk4 libadwaita imagemagick
|
run: brew install gtk4 libadwaita imagemagick
|
||||||
|
- name: Record macOS native lib versions for cache key
|
||||||
|
if: runner.os == 'macOS'
|
||||||
|
run: |
|
||||||
|
echo "MACOS_LIB_VER=$(brew list --versions glib gtk4 libadwaita | tr '\n' '_')" >> "$GITHUB_ENV"
|
||||||
|
- uses: Swatinem/rust-cache@v2
|
||||||
|
with:
|
||||||
|
prefix-key: ${{ env.MACOS_LIB_VER }}
|
||||||
- name: Install Windows Dependencies - create gtk dir
|
- name: Install Windows Dependencies - create gtk dir
|
||||||
if: runner.os == 'Windows'
|
if: runner.os == 'Windows'
|
||||||
run: mkdir C:\gtk-build\gtk\x64\release
|
run: mkdir C:\gtk-build\gtk\x64\release
|
||||||
|
|||||||
39
Cargo.lock
generated
39
Cargo.lock
generated
@@ -1898,12 +1898,6 @@ dependencies = [
|
|||||||
"vcpkg",
|
"vcpkg",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "linux-raw-sys"
|
|
||||||
version = "0.4.15"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "linux-raw-sys"
|
name = "linux-raw-sys"
|
||||||
version = "0.12.1"
|
version = "0.12.1"
|
||||||
@@ -2489,12 +2483,14 @@ checksum = "dc897dd8d9e8bd1ed8cdad82b5966c3e0ecae09fb1907d58efaa013543185d0a"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "reis"
|
name = "reis"
|
||||||
version = "0.5.0"
|
version = "0.7.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "00939c5c526a1b4054ef8d9d96b3f92227f08ca355965e986741b556eda6d289"
|
checksum = "81f3fedd2777cde52c1be5e572efbec485eac7b801c47820eda388d4f13b9c4b"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"futures",
|
"enumflags2",
|
||||||
"rustix 0.38.44",
|
"futures-util",
|
||||||
|
"log",
|
||||||
|
"rustix",
|
||||||
"tokio",
|
"tokio",
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -2540,19 +2536,6 @@ dependencies = [
|
|||||||
"nom",
|
"nom",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "rustix"
|
|
||||||
version = "0.38.44"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154"
|
|
||||||
dependencies = [
|
|
||||||
"bitflags 2.11.0",
|
|
||||||
"errno",
|
|
||||||
"libc",
|
|
||||||
"linux-raw-sys 0.4.15",
|
|
||||||
"windows-sys 0.59.0",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rustix"
|
name = "rustix"
|
||||||
version = "1.1.4"
|
version = "1.1.4"
|
||||||
@@ -2562,7 +2545,7 @@ dependencies = [
|
|||||||
"bitflags 2.11.0",
|
"bitflags 2.11.0",
|
||||||
"errno",
|
"errno",
|
||||||
"libc",
|
"libc",
|
||||||
"linux-raw-sys 0.12.1",
|
"linux-raw-sys",
|
||||||
"windows-sys 0.61.2",
|
"windows-sys 0.61.2",
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -2880,7 +2863,7 @@ dependencies = [
|
|||||||
"fastrand",
|
"fastrand",
|
||||||
"getrandom 0.4.2",
|
"getrandom 0.4.2",
|
||||||
"once_cell",
|
"once_cell",
|
||||||
"rustix 1.1.4",
|
"rustix",
|
||||||
"windows-sys 0.61.2",
|
"windows-sys 0.61.2",
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -3388,7 +3371,7 @@ checksum = "2857dd20b54e916ec7253b3d6b4d5c4d7d4ca2c33c2e11c6c76a99bd8744755d"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"cc",
|
"cc",
|
||||||
"downcast-rs",
|
"downcast-rs",
|
||||||
"rustix 1.1.4",
|
"rustix",
|
||||||
"smallvec",
|
"smallvec",
|
||||||
"wayland-sys",
|
"wayland-sys",
|
||||||
]
|
]
|
||||||
@@ -3400,7 +3383,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
checksum = "645c7c96bb74690c3189b5c9cb4ca1627062bb23693a4fad9d8c3de958260144"
|
checksum = "645c7c96bb74690c3189b5c9cb4ca1627062bb23693a4fad9d8c3de958260144"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 2.11.0",
|
"bitflags 2.11.0",
|
||||||
"rustix 1.1.4",
|
"rustix",
|
||||||
"wayland-backend",
|
"wayland-backend",
|
||||||
"wayland-scanner",
|
"wayland-scanner",
|
||||||
]
|
]
|
||||||
@@ -4065,7 +4048,7 @@ dependencies = [
|
|||||||
"hex",
|
"hex",
|
||||||
"libc",
|
"libc",
|
||||||
"ordered-stream",
|
"ordered-stream",
|
||||||
"rustix 1.1.4",
|
"rustix",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_repr",
|
"serde_repr",
|
||||||
"tokio",
|
"tokio",
|
||||||
|
|||||||
@@ -93,7 +93,8 @@ rdp_emulation = ["input-emulation/remote_desktop_portal"]
|
|||||||
|
|
||||||
[package.metadata.bundle]
|
[package.metadata.bundle]
|
||||||
name = "Lan Mouse"
|
name = "Lan Mouse"
|
||||||
icon = ["target/icon.icns"]
|
icon = ["target/icon.icns", "lan-mouse-gtk/resources/de.feschber.LanMouse.svg"]
|
||||||
identifier = "de.feschber.LanMouse"
|
identifier = "de.feschber.LanMouse"
|
||||||
|
deb_depends = [ "libadwaita-1-0" ]
|
||||||
osx_info_plist_exts = ["build-aux/macos-lsui-element.plist"]
|
osx_info_plist_exts = ["build-aux/macos-lsui-element.plist"]
|
||||||
resources = ["target/menubar-template.png"]
|
resources = ["target/menubar-template.png"]
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ ashpd = { version = "0.13.9", default-features = false, features = [
|
|||||||
"input_capture",
|
"input_capture",
|
||||||
"tokio",
|
"tokio",
|
||||||
], optional = true }
|
], optional = true }
|
||||||
reis = { version = "0.5.0", features = ["tokio"], optional = true }
|
reis = { version = "0.7.0", features = ["tokio"], optional = true }
|
||||||
|
|
||||||
[target.'cfg(target_os="macos")'.dependencies]
|
[target.'cfg(target_os="macos")'.dependencies]
|
||||||
core-graphics = { version = "0.25.0", features = ["highsierra"] }
|
core-graphics = { version = "0.25.0", features = ["highsierra"] }
|
||||||
|
|||||||
@@ -413,7 +413,15 @@ async fn do_capture_session(
|
|||||||
};
|
};
|
||||||
|
|
||||||
// find client corresponding to barrier
|
// find client corresponding to barrier
|
||||||
let pos = *pos_for_barrier_id.get(&barrier_id).expect("invalid barrier id");
|
let pos = match pos_for_barrier_id.get(&barrier_id) {
|
||||||
|
Some(id) => *id,
|
||||||
|
None => {
|
||||||
|
log::warn!("INVALID BARRIER ID: Id {barrier_id} does not exist!");
|
||||||
|
let id = find_corresponding_client(&barriers, activated.cursor_position().expect("no cursor position reported by compositor"));
|
||||||
|
let pos = *pos_for_barrier_id.get(&id).expect("invalid barrier id");
|
||||||
|
pos
|
||||||
|
},
|
||||||
|
};
|
||||||
current_pos.replace(Some(pos));
|
current_pos.replace(Some(pos));
|
||||||
|
|
||||||
// client entered => send event
|
// client entered => send event
|
||||||
@@ -529,15 +537,6 @@ fn distance_to_line(line: ((f32, f32), (f32, f32)), p: (f32, f32)) -> f32 {
|
|||||||
distance
|
distance
|
||||||
}
|
}
|
||||||
|
|
||||||
static ALL_CAPABILITIES: &[DeviceCapability] = &[
|
|
||||||
DeviceCapability::Pointer,
|
|
||||||
DeviceCapability::PointerAbsolute,
|
|
||||||
DeviceCapability::Keyboard,
|
|
||||||
DeviceCapability::Touch,
|
|
||||||
DeviceCapability::Scroll,
|
|
||||||
DeviceCapability::Button,
|
|
||||||
];
|
|
||||||
|
|
||||||
async fn handle_ei_event(
|
async fn handle_ei_event(
|
||||||
ei_event: EiEvent,
|
ei_event: EiEvent,
|
||||||
current_client: Option<Position>,
|
current_client: Option<Position>,
|
||||||
@@ -545,9 +544,15 @@ async fn handle_ei_event(
|
|||||||
event_tx: &Sender<(Position, CaptureEvent)>,
|
event_tx: &Sender<(Position, CaptureEvent)>,
|
||||||
release_session: &Notify,
|
release_session: &Notify,
|
||||||
) -> Result<(), CaptureError> {
|
) -> Result<(), CaptureError> {
|
||||||
|
let all_capabilities = DeviceCapability::Pointer
|
||||||
|
| DeviceCapability::PointerAbsolute
|
||||||
|
| DeviceCapability::Keyboard
|
||||||
|
| DeviceCapability::Touch
|
||||||
|
| DeviceCapability::Scroll
|
||||||
|
| DeviceCapability::Button;
|
||||||
match ei_event {
|
match ei_event {
|
||||||
EiEvent::SeatAdded(s) => {
|
EiEvent::SeatAdded(s) => {
|
||||||
s.seat.bind_capabilities(ALL_CAPABILITIES);
|
s.seat.bind_capabilities(all_capabilities);
|
||||||
context.flush().map_err(|e| io::Error::new(e.kind(), e))?;
|
context.flush().map_err(|e| io::Error::new(e.kind(), e))?;
|
||||||
}
|
}
|
||||||
EiEvent::SeatRemoved(_) | /* EiEvent::DeviceAdded(_) | */ EiEvent::DeviceRemoved(_) => {
|
EiEvent::SeatRemoved(_) | /* EiEvent::DeviceAdded(_) | */ EiEvent::DeviceRemoved(_) => {
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ ashpd = { version = "0.13.9", default-features = false, features = [
|
|||||||
"screencast",
|
"screencast",
|
||||||
"tokio",
|
"tokio",
|
||||||
], optional = true }
|
], optional = true }
|
||||||
reis = { version = "0.5.0", features = ["tokio"], optional = true }
|
reis = { version = "0.7.0", features = ["tokio"], optional = true }
|
||||||
|
|
||||||
[target.'cfg(target_os="macos")'.dependencies]
|
[target.'cfg(target_os="macos")'.dependencies]
|
||||||
bitflags = "2.6.0"
|
bitflags = "2.6.0"
|
||||||
|
|||||||
@@ -291,14 +291,12 @@ async fn ei_event_handler(
|
|||||||
) -> Result<(), EmulationError> {
|
) -> Result<(), EmulationError> {
|
||||||
loop {
|
loop {
|
||||||
let event = events.next().await.ok_or(EmulationError::EndOfStream)??;
|
let event = events.next().await.ok_or(EmulationError::EndOfStream)??;
|
||||||
const CAPABILITIES: &[DeviceCapability] = &[
|
let capabilities = DeviceCapability::Pointer
|
||||||
DeviceCapability::Pointer,
|
| DeviceCapability::PointerAbsolute
|
||||||
DeviceCapability::PointerAbsolute,
|
| DeviceCapability::Keyboard
|
||||||
DeviceCapability::Keyboard,
|
| DeviceCapability::Touch
|
||||||
DeviceCapability::Touch,
|
| DeviceCapability::Scroll
|
||||||
DeviceCapability::Scroll,
|
| DeviceCapability::Button;
|
||||||
DeviceCapability::Button,
|
|
||||||
];
|
|
||||||
log::debug!("{event:?}");
|
log::debug!("{event:?}");
|
||||||
match event {
|
match event {
|
||||||
EiEvent::Disconnected(e) => {
|
EiEvent::Disconnected(e) => {
|
||||||
@@ -306,7 +304,7 @@ async fn ei_event_handler(
|
|||||||
return Err(EmulationError::EndOfStream);
|
return Err(EmulationError::EndOfStream);
|
||||||
}
|
}
|
||||||
EiEvent::SeatAdded(e) => {
|
EiEvent::SeatAdded(e) => {
|
||||||
e.seat().bind_capabilities(CAPABILITIES);
|
e.seat().bind_capabilities(capabilities);
|
||||||
}
|
}
|
||||||
EiEvent::SeatRemoved(e) => {
|
EiEvent::SeatRemoved(e) => {
|
||||||
log::debug!("seat removed: {:?}", e.seat());
|
log::debug!("seat removed: {:?}", e.seat());
|
||||||
@@ -314,7 +312,6 @@ async fn ei_event_handler(
|
|||||||
EiEvent::DeviceAdded(e) => {
|
EiEvent::DeviceAdded(e) => {
|
||||||
let device_type = e.device().device_type();
|
let device_type = e.device().device_type();
|
||||||
log::debug!("device added: {device_type:?}");
|
log::debug!("device added: {device_type:?}");
|
||||||
e.device().device();
|
|
||||||
let device = e.device();
|
let device = e.device();
|
||||||
if let Some(pointer) = e.device().interface::<Pointer>() {
|
if let Some(pointer) = e.device().interface::<Pointer>() {
|
||||||
devices
|
devices
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ serde = { version = "1.0", features = ["derive"] }
|
|||||||
thiserror = "2.0.0"
|
thiserror = "2.0.0"
|
||||||
|
|
||||||
[target.'cfg(all(unix, not(target_os="macos")))'.dependencies]
|
[target.'cfg(all(unix, not(target_os="macos")))'.dependencies]
|
||||||
reis = { version = "0.5.0", optional = true }
|
reis = { version = "0.7.0", optional = true }
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = ["libei"]
|
default = ["libei"]
|
||||||
|
|||||||
Reference in New Issue
Block a user