diff options
| author | MaxVerevkin <maxxverrr@gmail.com> | 2023-09-07 17:42:38 +0300 |
|---|---|---|
| committer | MaxVerevkin <maxxverrr@gmail.com> | 2023-09-07 17:42:38 +0300 |
| commit | f6e91b9622db2a5772a0bf6bc6006c6f5a3eff4a (patch) | |
| tree | 4dcaea3214d7e99c205007be4a31a0bb25366678 /src/wm_info_provider.rs | |
| parent | 87673d7ecce661f3b8c5db949e70640934a55de9 (diff) | |
| download | i3bar-mango-f6e91b9622db2a5772a0bf6bc6006c6f5a3eff4a.tar.gz | |
more refactoring
Diffstat (limited to 'src/wm_info_provider.rs')
| -rw-r--r-- | src/wm_info_provider.rs | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/src/wm_info_provider.rs b/src/wm_info_provider.rs index 25eef05..59e0511 100644 --- a/src/wm_info_provider.rs +++ b/src/wm_info_provider.rs @@ -10,6 +10,9 @@ use crate::pointer_btn::PointerBtn; use crate::protocol::*; use crate::state::State; +mod dummy; +pub use dummy::*; + mod river; pub use river::*; @@ -22,7 +25,9 @@ pub trait WmInfoProvider { fn new_ouput(&mut self, _: &mut Connection<State>, _: &Output) {} fn output_removed(&mut self, _: &mut Connection<State>, _: &Output) {} - fn get_tags(&self, output: &Output) -> Vec<Tag>; + fn get_tags(&self, _: &Output) -> Vec<Tag> { + Vec::new() + } fn get_layout_name(&self, _: &Output) -> Option<String> { None } @@ -32,12 +37,13 @@ pub trait WmInfoProvider { fn click_on_tag( &mut self, - conn: &mut Connection<State>, - output: WlOutput, - seat: WlSeat, - tag_id: u32, - btn: PointerBtn, - ); + _conn: &mut Connection<State>, + _output: WlOutput, + _seat: WlSeat, + _tag_id: u32, + _btn: PointerBtn, + ) { + } fn as_any(&mut self) -> &mut dyn Any; } @@ -46,16 +52,16 @@ pub fn bind( conn: &mut Connection<State>, globals: &Globals, config: &WmConfig, -) -> Option<Box<dyn WmInfoProvider>> { +) -> Box<dyn WmInfoProvider> { if let Some(river) = RiverInfoProvider::bind(conn, globals, config) { - return Some(Box::new(river)); + return Box::new(river); } - if let Some(hyprland) = Hyprland::new() { - return Some(Box::new(hyprland)); + if let Some(hyprland) = HyprlandInfoProvider::new() { + return Box::new(hyprland); } - None + Box::new(DummyInfoProvider) } #[derive(Debug)] |
