Skip to content

Commit

Permalink
'adding a matching strategy to the exe configuration option'
Browse files Browse the repository at this point in the history
  • Loading branch information
Abdalrahman Mursi authored and LGUG2Z committed Jan 1, 2024
1 parent a7eed06 commit 0729975
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/configuration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ pub type Configuration = Vec<Entry>;
pub struct Entry {
pub exe: String,
pub target_layer: String,
pub strategy: Option<Strategy>,
pub title_overrides: Option<Vec<TitleOverride>>,
pub virtual_key_overrides: Option<Vec<VirtualKeyOverride>>,
pub virtual_key_ignores: Option<Vec<i32>>,
Expand Down
3 changes: 2 additions & 1 deletion src/events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ fn calculate_target(
let configuration = CONFIG.get().unwrap();
let mut new_layer = default;
for entry in configuration {
if entry.exe == exe {
let entry_strategy = entry.strategy.clone().unwrap_or(Strategy::Equals);
if matches_with_strategy(exe, &entry.exe, &entry_strategy) {
if matches!(event, Event::FocusChange) {
new_layer = Option::from(entry.target_layer.as_str());
}
Expand Down

0 comments on commit 0729975

Please sign in to comment.