refactor(ffm): add selection of ffm implementation

This commit adds an optional flag to allow users to select the focus
follows mouse implementation that they wish to use (komorebi or
windows). The flag defaults to komorebi.

The ahk-derive crate has been updated to enable the generation of
wrappers fns that require flags.

I pushed the ffm check up to listen_for_movements() so that we don't
even try to listen to the next event from the message loop unless
komorebi-flavoured ffm is enabled.

re #7
This commit is contained in:
LGUG2Z
2021-09-04 13:14:45 -07:00
parent ce3c742e09
commit 2b7c51b87b
9 changed files with 258 additions and 55 deletions

View File

@@ -68,8 +68,8 @@ pub enum SocketMessage {
IdentifyTrayApplication(ApplicationIdentifier, String),
State,
Query(StateQuery),
FocusFollowsMouse(bool),
ToggleFocusFollowsMouse,
FocusFollowsMouse(FocusFollowsMouseImplementation, bool),
ToggleFocusFollowsMouse(FocusFollowsMouseImplementation),
}
impl SocketMessage {
@@ -107,6 +107,13 @@ pub enum ApplicationIdentifier {
Title,
}
#[derive(Clone, Debug, Serialize, Deserialize, Display, EnumString, ArgEnum)]
#[strum(serialize_all = "snake_case")]
pub enum FocusFollowsMouseImplementation {
Komorebi,
Windows,
}
#[derive(Clone, Copy, Debug, Serialize, Deserialize, Display, EnumString, ArgEnum)]
#[strum(serialize_all = "snake_case")]
pub enum Sizing {