1
0
Fork 0
mirror of https://github.com/Zedfrigg/ironbar.git synced 2025-07-06 12:51:03 +02:00

refactor: move most of the horrible add_module macro content into proper functions

This commit is contained in:
Jake Stanger 2022-12-04 23:23:22 +00:00
parent 490f3f3f65
commit 2c1b2924d4
No known key found for this signature in database
GPG key ID: C51FC8F9CB0BEA61
15 changed files with 317 additions and 344 deletions

View file

@ -9,6 +9,7 @@ const STATE_ACTIVE: u32 = 2;
const STATE_FULLSCREEN: u32 = 3;
static COUNTER: AtomicUsize = AtomicUsize::new(1);
fn get_id() -> usize {
COUNTER.fetch_add(1, Ordering::Relaxed)
}
@ -108,9 +109,9 @@ where
None
}
}
Event::OutputEnter { output: _ } => None,
Event::OutputLeave { output: _ } => None,
Event::Parent { parent: _ } => None,
Event::OutputEnter { output: _ }
| Event::OutputLeave { output: _ }
| Event::Parent { parent: _ } => None,
Event::Done => {
if info.ready || info.app_id.is_empty() {
None
@ -119,6 +120,7 @@ where
Some(ToplevelChange::New)
}
}
_ => unreachable!(),
};