Compare commits

..

3 Commits

Author SHA1 Message Date
Ferdinand Schober
ac5ba3da37 Merge branch 'main' into move-feature-flags-to-build-script 2026-05-16 17:09:29 +02:00
Ferdinand Schober
743895516c same for input-emulation 2026-05-16 12:23:26 +02:00
Ferdinand Schober
b65ca44ea2 move feature flags to build.rs 2026-05-16 12:16:09 +02:00
14 changed files with 56 additions and 152 deletions

View File

@@ -174,16 +174,13 @@ jobs:
steps: steps:
- name: Download build artifacts - name: Download build artifacts
uses: actions/download-artifact@v4 uses: actions/download-artifact@v4
- name: Get short SHA
id: vars
run: echo "short_sha=${GITHUB_SHA::7}" >> "$GITHUB_OUTPUT"
- name: Create Pre-Release - name: Create Pre-Release
if: ${{ !startsWith(github.ref, 'refs/tags/') }} if: ${{ !startsWith(github.ref, 'refs/tags/') }}
uses: softprops/action-gh-release@v2 uses: softprops/action-gh-release@v2
with: with:
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
tag_name: ${{ format('{0}-{1}', github.event.inputs.name || github.ref_name, steps.vars.outputs.short_sha) }} tag_name: ${{ github.event.inputs.name || github.ref_name }}
name: ${{ format('{0}-{1}', github.event.inputs.name || github.ref_name, steps.vars.outputs.short_sha) }} name: ${{ github.event.inputs.name || github.ref_name }}
prerelease: true prerelease: true
generate_release_notes: true generate_release_notes: true
files: | files: |

View File

@@ -28,7 +28,7 @@ Lan Mouse is an open-source Software KVM sharing mouse/keyboard input across loc
## Feature & cfg discipline ## Feature & cfg discipline
- Feature flags live in root `Cargo.toml`. Gate OS-specific modules with the configs exported in build.rs (e.g., `cfg(layer_shell)`). - Feature flags live in root `Cargo.toml`. Gate OS-specific modules with tight cfgs (e.g., `cfg(all(unix, feature = "layer_shell", not(target_os = "macos")))`).
- Prefer module-level gating over per-function cfgs to avoid empty stubs. - Prefer module-level gating over per-function cfgs to avoid empty stubs.
- New backends: add feature in `Cargo.toml`, create gated module, log backend selection. - New backends: add feature in `Cargo.toml`, create gated module, log backend selection.

16
Cargo.lock generated
View File

@@ -1647,7 +1647,7 @@ dependencies = [
[[package]] [[package]]
name = "input-capture" name = "input-capture"
version = "0.4.0" version = "0.3.0"
dependencies = [ dependencies = [
"ashpd", "ashpd",
"async-trait", "async-trait",
@@ -1677,7 +1677,7 @@ dependencies = [
[[package]] [[package]]
name = "input-emulation" name = "input-emulation"
version = "0.4.0" version = "0.3.0"
dependencies = [ dependencies = [
"ashpd", "ashpd",
"async-trait", "async-trait",
@@ -1703,7 +1703,7 @@ dependencies = [
[[package]] [[package]]
name = "input-event" name = "input-event"
version = "0.4.0" version = "0.3.0"
dependencies = [ dependencies = [
"futures-core", "futures-core",
"log", "log",
@@ -1840,7 +1840,7 @@ dependencies = [
[[package]] [[package]]
name = "lan-mouse" name = "lan-mouse"
version = "0.11.0" version = "0.10.0"
dependencies = [ dependencies = [
"clap", "clap",
"env_logger", "env_logger",
@@ -1875,7 +1875,7 @@ dependencies = [
[[package]] [[package]]
name = "lan-mouse-cli" name = "lan-mouse-cli"
version = "0.3.0" version = "0.2.0"
dependencies = [ dependencies = [
"clap", "clap",
"futures", "futures",
@@ -1886,7 +1886,7 @@ dependencies = [
[[package]] [[package]]
name = "lan-mouse-gtk" name = "lan-mouse-gtk"
version = "0.3.0" version = "0.2.0"
dependencies = [ dependencies = [
"async-channel", "async-channel",
"glib-build-tools", "glib-build-tools",
@@ -1900,7 +1900,7 @@ dependencies = [
[[package]] [[package]]
name = "lan-mouse-ipc" name = "lan-mouse-ipc"
version = "0.3.0" version = "0.2.0"
dependencies = [ dependencies = [
"futures", "futures",
"log", "log",
@@ -1913,7 +1913,7 @@ dependencies = [
[[package]] [[package]]
name = "lan-mouse-proto" name = "lan-mouse-proto"
version = "0.3.0" version = "0.2.0"
dependencies = [ dependencies = [
"input-event", "input-event",
"num_enum", "num_enum",

View File

@@ -12,7 +12,7 @@ members = [
[package] [package]
name = "lan-mouse" name = "lan-mouse"
description = "Software KVM Switch / mouse & keyboard sharing software for Local Area Networks" description = "Software KVM Switch / mouse & keyboard sharing software for Local Area Networks"
version = "0.11.0" version = "0.10.0"
edition = "2021" edition = "2021"
license = "GPL-3.0-or-later" license = "GPL-3.0-or-later"
repository = "https://github.com/feschber/lan-mouse" repository = "https://github.com/feschber/lan-mouse"
@@ -27,13 +27,13 @@ panic = "abort"
shadow-rs = "1.2.0" shadow-rs = "1.2.0"
[dependencies] [dependencies]
input-event = { path = "input-event", version = "0.4.0" } input-event = { path = "input-event", version = "0.3.0" }
input-emulation = { path = "input-emulation", version = "0.4.0", default-features = false } input-emulation = { path = "input-emulation", version = "0.3.0", default-features = false }
input-capture = { path = "input-capture", version = "0.4.0", default-features = false } input-capture = { path = "input-capture", version = "0.3.0", default-features = false }
lan-mouse-cli = { path = "lan-mouse-cli", version = "0.3.0" } lan-mouse-cli = { path = "lan-mouse-cli", version = "0.2.0" }
lan-mouse-gtk = { path = "lan-mouse-gtk", version = "0.3.0", optional = true } lan-mouse-gtk = { path = "lan-mouse-gtk", version = "0.2.0", optional = true }
lan-mouse-ipc = { path = "lan-mouse-ipc", version = "0.3.0" } lan-mouse-ipc = { path = "lan-mouse-ipc", version = "0.2.0" }
lan-mouse-proto = { path = "lan-mouse-proto", version = "0.3.0" } lan-mouse-proto = { path = "lan-mouse-proto", version = "0.2.0" }
shadow-rs = { version = "1.2.0", features = ["metadata"] } shadow-rs = { version = "1.2.0", features = ["metadata"] }
hickory-resolver = "0.25.2" hickory-resolver = "0.25.2"

View File

@@ -5,57 +5,4 @@ fn main() {
.deny_const(Default::default()) .deny_const(Default::default())
.build() .build()
.expect("shadow build"); .expect("shadow build");
let unix = cfg!(unix);
let macos = cfg!(target_os = "macos");
let layer_shell_capture = cfg!(feature = "layer_shell_capture");
let libei_capture = cfg!(feature = "libei_capture");
let x11_capture = cfg!(feature = "x11_capture");
let libei_emulation = cfg!(feature = "libei_emulation");
let x11_emulation = cfg!(feature = "x11_emulation");
let wlroots_emulation = cfg!(feature = "wlroots_emulation");
let rdp_emulation = cfg!(feature = "rdp_emulation");
let layer_shell_capture = unix && !macos && layer_shell_capture;
let libei_capture = unix && !macos && libei_capture;
let x11_capture = unix && !macos && x11_capture;
let libei_emulation = unix && !macos && libei_emulation;
let rdp_emulation = unix && !macos && rdp_emulation;
let wlroots_emulation = unix && !macos && wlroots_emulation;
let x11_emulation = unix && !macos && x11_emulation;
println!("cargo::rustc-check-cfg=cfg(layer_shell_capture)");
println!("cargo::rustc-check-cfg=cfg(libei_capture)");
println!("cargo::rustc-check-cfg=cfg(x11_capture)");
println!("cargo::rustc-check-cfg=cfg(libei_emulation)");
println!("cargo::rustc-check-cfg=cfg(rdp_emulation)");
println!("cargo::rustc-check-cfg=cfg(wlroots_emulation)");
println!("cargo::rustc-check-cfg=cfg(x11_emulation)");
if layer_shell_capture {
println!("cargo::rustc-cfg=layer_shell_capture");
}
if libei_capture {
println!("cargo::rustc-cfg=libei_capture");
}
if x11_capture {
println!("cargo::rustc-cfg=x11_capture");
}
if libei_emulation {
println!("cargo::rustc-cfg=libei_emulation");
}
if rdp_emulation {
println!("cargo::rustc-cfg=rdp_emulation");
}
if wlroots_emulation {
println!("cargo::rustc-cfg=wlroots_emulation");
}
if x11_emulation {
println!("cargo::rustc-cfg=x11_emulation");
}
} }

View File

@@ -1,7 +1,7 @@
[package] [package]
name = "input-capture" name = "input-capture"
description = "cross-platform input-capture library used by lan-mouse" description = "cross-platform input-capture library used by lan-mouse"
version = "0.4.0" version = "0.3.0"
edition = "2021" edition = "2021"
license = "GPL-3.0-or-later" license = "GPL-3.0-or-later"
repository = "https://github.com/feschber/lan-mouse" repository = "https://github.com/feschber/lan-mouse"
@@ -10,7 +10,7 @@ repository = "https://github.com/feschber/lan-mouse"
futures = "0.3.28" futures = "0.3.28"
futures-core = "0.3.30" futures-core = "0.3.30"
log = "0.4.22" log = "0.4.22"
input-event = { path = "../input-event", version = "0.4.0" } input-event = { path = "../input-event", version = "0.3.0" }
memmap = "0.7" memmap = "0.7"
tempfile = "3.25.0" tempfile = "3.25.0"
thiserror = "2.0.0" thiserror = "2.0.0"

View File

@@ -1,7 +1,7 @@
[package] [package]
name = "input-emulation" name = "input-emulation"
description = "cross-platform input emulation library used by lan-mouse" description = "cross-platform input emulation library used by lan-mouse"
version = "0.4.0" version = "0.3.0"
edition = "2021" edition = "2021"
license = "GPL-3.0-or-later" license = "GPL-3.0-or-later"
repository = "https://github.com/feschber/lan-mouse" repository = "https://github.com/feschber/lan-mouse"
@@ -10,7 +10,7 @@ repository = "https://github.com/feschber/lan-mouse"
async-trait = "0.1.80" async-trait = "0.1.80"
futures = "0.3.28" futures = "0.3.28"
log = "0.4.22" log = "0.4.22"
input-event = { path = "../input-event", version = "0.4.0" } input-event = { path = "../input-event", version = "0.3.0" }
thiserror = "2.0.0" thiserror = "2.0.0"
tokio = { version = "1.32.0", features = [ tokio = { version = "1.32.0", features = [
"io-util", "io-util",

View File

@@ -106,19 +106,8 @@ impl MacOSEmulation {
} }
} }
} }
// Always release the key with the correct CGKeyCode, regardless of // release key when cancelled
// whether the repeat loop ran. This matches @feschber's review update_modifiers(&modifiers, key as u32, 0);
// request: "still release the key repeat task but with the correct
// code."
//
// Do NOT call update_modifiers here: `key` is a Mac CGKeyCode but
// update_modifiers expects a Linux evdev scancode, and the two
// codespaces collide (e.g. Mac LeftShift=56 == Linux KeyLeftAlt=56,
// Mac Down=125 == Linux KeyLeftMeta=125), corrupting modifier
// state for chords like Shift+Option+X or Cmd+Down. Modifier state
// is owned by the main consume() loop, which already calls
// update_modifiers with the correct Linux scancode on the real key
// release event from the client.
key_event(event_source.clone(), key, 0, modifiers.get()); key_event(event_source.clone(), key, 0, modifiers.get());
}); });
self.repeat_task = Some(repeat_task); self.repeat_task = Some(repeat_task);
@@ -168,19 +157,6 @@ extern "C" {
fn AXIsProcessTrusted() -> bool; fn AXIsProcessTrusted() -> bool;
} }
/// Mac virtual key codes for the four arrow keys.
const MAC_KEY_LEFT: u16 = 0x7B;
const MAC_KEY_RIGHT: u16 = 0x7C;
const MAC_KEY_DOWN: u16 = 0x7D;
const MAC_KEY_UP: u16 = 0x7E;
fn is_arrow_key(key: u16) -> bool {
matches!(
key,
MAC_KEY_LEFT | MAC_KEY_RIGHT | MAC_KEY_DOWN | MAC_KEY_UP
)
}
fn key_event(event_source: CGEventSource, key: u16, state: u8, modifiers: XMods) { fn key_event(event_source: CGEventSource, key: u16, state: u8, modifiers: XMods) {
let event = match CGEvent::new_keyboard_event(event_source, key, state != 0) { let event = match CGEvent::new_keyboard_event(event_source, key, state != 0) {
Ok(e) => e, Ok(e) => e,
@@ -189,15 +165,7 @@ fn key_event(event_source: CGEventSource, key: u16, state: u8, modifiers: XMods)
return; return;
} }
}; };
let mut flags = to_cgevent_flags(modifiers); event.set_flags(to_cgevent_flags(modifiers));
// Hardware-generated arrow keys on macOS carry NumericPad + SecondaryFn.
// CGEventTap-based hotkey matchers (e.g. tiling window managers) check
// these flags to recognize navigation keys; without them synthesized
// arrow chords fall through to the focused app.
if is_arrow_key(key) {
flags |= CGEventFlags::CGEventFlagNumericPad | CGEventFlags::CGEventFlagSecondaryFn;
}
event.set_flags(flags);
event.post(CGEventTapLocation::HID); event.post(CGEventTapLocation::HID);
log::trace!("key event: {key} {state}"); log::trace!("key event: {key} {state}");
} }

View File

@@ -1,7 +1,7 @@
[package] [package]
name = "input-event" name = "input-event"
description = "cross-platform input-event types for input-capture / input-emulation" description = "cross-platform input-event types for input-capture / input-emulation"
version = "0.4.0" version = "0.3.0"
edition = "2021" edition = "2021"
license = "GPL-3.0-or-later" license = "GPL-3.0-or-later"
repository = "https://github.com/feschber/lan-mouse" repository = "https://github.com/feschber/lan-mouse"

View File

@@ -1,14 +1,14 @@
[package] [package]
name = "lan-mouse-cli" name = "lan-mouse-cli"
description = "CLI Frontend for lan-mouse" description = "CLI Frontend for lan-mouse"
version = "0.3.0" version = "0.2.0"
edition = "2021" edition = "2021"
license = "GPL-3.0-or-later" license = "GPL-3.0-or-later"
repository = "https://github.com/feschber/lan-mouse" repository = "https://github.com/feschber/lan-mouse"
[dependencies] [dependencies]
futures = "0.3.30" futures = "0.3.30"
lan-mouse-ipc = { path = "../lan-mouse-ipc", version = "0.3.0" } lan-mouse-ipc = { path = "../lan-mouse-ipc", version = "0.2.0" }
clap = { version = "4.4.11", features = ["derive"] } clap = { version = "4.4.11", features = ["derive"] }
thiserror = "2.0.0" thiserror = "2.0.0"
tokio = { version = "1.32.0", features = [ tokio = { version = "1.32.0", features = [

View File

@@ -1,7 +1,7 @@
[package] [package]
name = "lan-mouse-gtk" name = "lan-mouse-gtk"
description = "GTK4 / Libadwaita Frontend for lan-mouse" description = "GTK4 / Libadwaita Frontend for lan-mouse"
version = "0.3.0" version = "0.2.0"
edition = "2021" edition = "2021"
license = "GPL-3.0-or-later" license = "GPL-3.0-or-later"
repository = "https://github.com/feschber/lan-mouse" repository = "https://github.com/feschber/lan-mouse"
@@ -12,7 +12,7 @@ adw = { package = "libadwaita", version = "0.7.0", features = ["v1_1"] }
async-channel = { version = "2.1.1" } async-channel = { version = "2.1.1" }
hostname = "0.4.0" hostname = "0.4.0"
log = "0.4.20" log = "0.4.20"
lan-mouse-ipc = { path = "../lan-mouse-ipc", version = "0.3.0" } lan-mouse-ipc = { path = "../lan-mouse-ipc", version = "0.2.0" }
thiserror = "2.0.0" thiserror = "2.0.0"
[build-dependencies] [build-dependencies]

View File

@@ -1,7 +1,7 @@
[package] [package]
name = "lan-mouse-ipc" name = "lan-mouse-ipc"
description = "library for communication between lan-mouse service and frontends" description = "library for communication between lan-mouse service and frontends"
version = "0.3.0" version = "0.2.0"
edition = "2021" edition = "2021"
license = "GPL-3.0-or-later" license = "GPL-3.0-or-later"
repository = "https://github.com/feschber/lan-mouse" repository = "https://github.com/feschber/lan-mouse"

View File

@@ -1,7 +1,7 @@
[package] [package]
name = "lan-mouse-proto" name = "lan-mouse-proto"
description = "network protocol for lan-mouse" description = "network protocol for lan-mouse"
version = "0.3.0" version = "0.2.0"
edition = "2021" edition = "2021"
license = "GPL-3.0-or-later" license = "GPL-3.0-or-later"
repository = "https://github.com/feschber/lan-mouse" repository = "https://github.com/feschber/lan-mouse"
@@ -9,5 +9,5 @@ repository = "https://github.com/feschber/lan-mouse"
[dependencies] [dependencies]
num_enum = "0.7.2" num_enum = "0.7.2"
thiserror = "2.0.0" thiserror = "2.0.0"
input-event = { path = "../input-event", version = "0.4.0" } input-event = { path = "../input-event", version = "0.3.0" }
paste = "1.0" paste = "1.0"

View File

@@ -1,7 +1,6 @@
use crate::capture_test::TestCaptureArgs; use crate::capture_test::TestCaptureArgs;
use crate::emulation_test::TestEmulationArgs; use crate::emulation_test::TestEmulationArgs;
use clap::{Parser, Subcommand, ValueEnum}; use clap::{Parser, Subcommand, ValueEnum};
use notify::event::ModifyKind;
use notify::{EventKind, RecommendedWatcher, Watcher}; use notify::{EventKind, RecommendedWatcher, Watcher};
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use std::collections::HashMap; use std::collections::HashMap;
@@ -119,13 +118,13 @@ pub enum Command {
#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize, ValueEnum)] #[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize, ValueEnum)]
pub enum CaptureBackend { pub enum CaptureBackend {
#[cfg(libei_capture)] #[cfg(all(unix, feature = "libei_capture", not(target_os = "macos")))]
#[serde(rename = "input-capture-portal")] #[serde(rename = "input-capture-portal")]
InputCapturePortal, InputCapturePortal,
#[cfg(layer_shell_capture)] #[cfg(all(unix, feature = "layer_shell_capture", not(target_os = "macos")))]
#[serde(rename = "layer-shell")] #[serde(rename = "layer-shell")]
LayerShell, LayerShell,
#[cfg(x11_capture)] #[cfg(all(unix, feature = "x11_capture", not(target_os = "macos")))]
#[serde(rename = "x11")] #[serde(rename = "x11")]
X11, X11,
#[cfg(windows)] #[cfg(windows)]
@@ -141,11 +140,11 @@ pub enum CaptureBackend {
impl Display for CaptureBackend { impl Display for CaptureBackend {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self { match self {
#[cfg(libei_capture)] #[cfg(all(unix, feature = "libei_capture", not(target_os = "macos")))]
CaptureBackend::InputCapturePortal => write!(f, "input-capture-portal"), CaptureBackend::InputCapturePortal => write!(f, "input-capture-portal"),
#[cfg(layer_shell_capture)] #[cfg(all(unix, feature = "layer_shell_capture", not(target_os = "macos")))]
CaptureBackend::LayerShell => write!(f, "layer-shell"), CaptureBackend::LayerShell => write!(f, "layer-shell"),
#[cfg(x11_capture)] #[cfg(all(unix, feature = "x11_capture", not(target_os = "macos")))]
CaptureBackend::X11 => write!(f, "X11"), CaptureBackend::X11 => write!(f, "X11"),
#[cfg(windows)] #[cfg(windows)]
CaptureBackend::Windows => write!(f, "windows"), CaptureBackend::Windows => write!(f, "windows"),
@@ -159,11 +158,11 @@ impl Display for CaptureBackend {
impl From<CaptureBackend> for input_capture::Backend { impl From<CaptureBackend> for input_capture::Backend {
fn from(backend: CaptureBackend) -> Self { fn from(backend: CaptureBackend) -> Self {
match backend { match backend {
#[cfg(libei_capture)] #[cfg(all(unix, feature = "libei_capture", not(target_os = "macos")))]
CaptureBackend::InputCapturePortal => Self::InputCapturePortal, CaptureBackend::InputCapturePortal => Self::InputCapturePortal,
#[cfg(layer_shell_capture)] #[cfg(all(unix, feature = "layer_shell_capture", not(target_os = "macos")))]
CaptureBackend::LayerShell => Self::LayerShell, CaptureBackend::LayerShell => Self::LayerShell,
#[cfg(x11_capture)] #[cfg(all(unix, feature = "x11_capture", not(target_os = "macos")))]
CaptureBackend::X11 => Self::X11, CaptureBackend::X11 => Self::X11,
#[cfg(windows)] #[cfg(windows)]
CaptureBackend::Windows => Self::Windows, CaptureBackend::Windows => Self::Windows,
@@ -176,16 +175,16 @@ impl From<CaptureBackend> for input_capture::Backend {
#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize, ValueEnum)] #[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize, ValueEnum)]
pub enum EmulationBackend { pub enum EmulationBackend {
#[cfg(wlroots_emulation)] #[cfg(all(unix, feature = "wlroots_emulation", not(target_os = "macos")))]
#[serde(rename = "wlroots")] #[serde(rename = "wlroots")]
Wlroots, Wlroots,
#[cfg(libei_emulation)] #[cfg(all(unix, feature = "libei_emulation", not(target_os = "macos")))]
#[serde(rename = "libei")] #[serde(rename = "libei")]
Libei, Libei,
#[cfg(rdp_emulation)] #[cfg(all(unix, feature = "rdp_emulation", not(target_os = "macos")))]
#[serde(rename = "xdp")] #[serde(rename = "xdp")]
Xdp, Xdp,
#[cfg(x11_emulation)] #[cfg(all(unix, feature = "x11_emulation", not(target_os = "macos")))]
#[serde(rename = "x11")] #[serde(rename = "x11")]
X11, X11,
#[cfg(windows)] #[cfg(windows)]
@@ -201,13 +200,13 @@ pub enum EmulationBackend {
impl From<EmulationBackend> for input_emulation::Backend { impl From<EmulationBackend> for input_emulation::Backend {
fn from(backend: EmulationBackend) -> Self { fn from(backend: EmulationBackend) -> Self {
match backend { match backend {
#[cfg(wlroots_emulation)] #[cfg(all(unix, feature = "wlroots_emulation", not(target_os = "macos")))]
EmulationBackend::Wlroots => Self::Wlroots, EmulationBackend::Wlroots => Self::Wlroots,
#[cfg(libei_emulation)] #[cfg(all(unix, feature = "libei_emulation", not(target_os = "macos")))]
EmulationBackend::Libei => Self::Libei, EmulationBackend::Libei => Self::Libei,
#[cfg(rdp_emulation)] #[cfg(all(unix, feature = "rdp_emulation", not(target_os = "macos")))]
EmulationBackend::Xdp => Self::Xdp, EmulationBackend::Xdp => Self::Xdp,
#[cfg(x11_emulation)] #[cfg(all(unix, feature = "x11_emulation", not(target_os = "macos")))]
EmulationBackend::X11 => Self::X11, EmulationBackend::X11 => Self::X11,
#[cfg(windows)] #[cfg(windows)]
EmulationBackend::Windows => Self::Windows, EmulationBackend::Windows => Self::Windows,
@@ -221,13 +220,13 @@ impl From<EmulationBackend> for input_emulation::Backend {
impl Display for EmulationBackend { impl Display for EmulationBackend {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self { match self {
#[cfg(wlroots_emulation)] #[cfg(all(unix, feature = "wlroots_emulation", not(target_os = "macos")))]
EmulationBackend::Wlroots => write!(f, "wlroots"), EmulationBackend::Wlroots => write!(f, "wlroots"),
#[cfg(libei_emulation)] #[cfg(all(unix, feature = "libei_emulation", not(target_os = "macos")))]
EmulationBackend::Libei => write!(f, "libei"), EmulationBackend::Libei => write!(f, "libei"),
#[cfg(rdp_emulation)] #[cfg(all(unix, feature = "rdp_emulation", not(target_os = "macos")))]
EmulationBackend::Xdp => write!(f, "xdg-desktop-portal"), EmulationBackend::Xdp => write!(f, "xdg-desktop-portal"),
#[cfg(x11_emulation)] #[cfg(all(unix, feature = "x11_emulation", not(target_os = "macos")))]
EmulationBackend::X11 => write!(f, "X11"), EmulationBackend::X11 => write!(f, "X11"),
#[cfg(windows)] #[cfg(windows)]
EmulationBackend::Windows => write!(f, "windows"), EmulationBackend::Windows => write!(f, "windows"),
@@ -407,9 +406,7 @@ impl Config {
if event.paths.contains(&self.config_path) if event.paths.contains(&self.config_path)
&& matches!( && matches!(
event.kind, event.kind,
EventKind::Create(_) EventKind::Create(_) | EventKind::Modify(_) | EventKind::Remove(_)
| EventKind::Modify(ModifyKind::Data(_))
| EventKind::Remove(_)
) )
&& self.read_from_disk()? && self.read_from_disk()?
{ {
@@ -527,11 +524,6 @@ impl Config {
} }
Err(e) => log::warn!("{:?} {e}", self.config_path()), Err(e) => log::warn!("{:?} {e}", self.config_path()),
}; };
if changed {
log::info!("config changed");
} else {
log::info!("config unchanged");
}
Ok(changed) Ok(changed)
} }