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
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!(),
};