mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-11-17 22:33:12 +01:00
refactor(mac): use the shared pause filter
read_commands_uds now asks komorebi_transport::allowed_while_paused instead of listing TogglePause, State, GlobalState and Stop in a match. Same behaviour: while paused those four are handled, any other message is dropped with the same trace log, and the connection ends after either. komorebi-transport is added as a path dependency of the macOS workspace. Verified: macOS fake-CC cargo check --locked --target aarch64-apple-darwin --workspace --all-targets in komorebi-for-mac: 0 errors (warnings only, pre-existing). Unit tests cannot run on Linux.
This commit is contained in:
1 parent
42d78e887d
commit
587defe3c9
4 files changed
+16
-9
No files matched your search
Generated
+8
@@ -3169,6 +3169,7 @@ dependencies = [
|
|||||||
"komorebi-layouts",
|
"komorebi-layouts",
|
||||||
"komorebi-protocol",
|
"komorebi-protocol",
|
||||||
"komorebi-themes",
|
"komorebi-themes",
|
||||||
|
"komorebi-transport",
|
||||||
"lazy_static",
|
"lazy_static",
|
||||||
"nanoid",
|
"nanoid",
|
||||||
"objc2 0.6.5",
|
"objc2 0.6.5",
|
||||||
@@ -3305,6 +3306,13 @@ dependencies = [
|
|||||||
"strum",
|
"strum",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "komorebi-transport"
|
||||||
|
version = "0.1.42"
|
||||||
|
dependencies = [
|
||||||
|
"komorebi-protocol",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "komorebic"
|
name = "komorebic"
|
||||||
version = "0.1.1"
|
version = "0.1.1"
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ version = "0.1.0"
|
|||||||
komorebi-themes = { path = "../komorebi-themes" }
|
komorebi-themes = { path = "../komorebi-themes" }
|
||||||
komorebi-collections = { path = "../crates/komorebi-collections" }
|
komorebi-collections = { path = "../crates/komorebi-collections" }
|
||||||
komorebi-protocol = { path = "../crates/komorebi-protocol", default-features = false, features = ["schemars"] }
|
komorebi-protocol = { path = "../crates/komorebi-protocol", default-features = false, features = ["schemars"] }
|
||||||
|
komorebi-transport = { path = "../crates/komorebi-transport" }
|
||||||
komorebi-layouts = { path = "../komorebi-layouts", features = [
|
komorebi-layouts = { path = "../komorebi-layouts", features = [
|
||||||
"darwin",
|
"darwin",
|
||||||
"schemars",
|
"schemars",
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ komorebi-themes = { workspace = true }
|
|||||||
komorebi-collections = { workspace = true }
|
komorebi-collections = { workspace = true }
|
||||||
komorebi-layouts = { workspace = true }
|
komorebi-layouts = { workspace = true }
|
||||||
komorebi-protocol = { workspace = true }
|
komorebi-protocol = { workspace = true }
|
||||||
|
komorebi-transport = { workspace = true }
|
||||||
quickxml_to_serde = { git = "https://github.com/LGUG2Z/quickxml_to_serde.git", version = "0.6.1" }
|
quickxml_to_serde = { git = "https://github.com/LGUG2Z/quickxml_to_serde.git", version = "0.6.1" }
|
||||||
version = { path = "../version" }
|
version = { path = "../version" }
|
||||||
|
|
||||||
|
|||||||
@@ -59,6 +59,7 @@ use color_eyre::eyre;
|
|||||||
use color_eyre::eyre::Context;
|
use color_eyre::eyre::Context;
|
||||||
use color_eyre::eyre::OptionExt;
|
use color_eyre::eyre::OptionExt;
|
||||||
use komorebi_themes::colour::Rgb;
|
use komorebi_themes::colour::Rgb;
|
||||||
|
use komorebi_transport::allowed_while_paused;
|
||||||
use objc2_core_foundation::CFDictionary;
|
use objc2_core_foundation::CFDictionary;
|
||||||
use parking_lot::Mutex;
|
use parking_lot::Mutex;
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
@@ -1933,15 +1934,11 @@ pub fn read_commands_uds(
|
|||||||
}
|
}
|
||||||
Some(mut wm) => {
|
Some(mut wm) => {
|
||||||
if wm.is_paused {
|
if wm.is_paused {
|
||||||
return match message {
|
return if allowed_while_paused(&message) {
|
||||||
SocketMessage::TogglePause
|
Ok(wm.process_command(message, &mut stream)?)
|
||||||
| SocketMessage::State
|
} else {
|
||||||
| SocketMessage::GlobalState
|
tracing::trace!("ignoring while paused");
|
||||||
| SocketMessage::Stop => Ok(wm.process_command(message, &mut stream)?),
|
Ok(())
|
||||||
_ => {
|
|
||||||
tracing::trace!("ignoring while paused");
|
|
||||||
Ok(())
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user