summaryrefslogtreecommitdiff
path: root/src/wm_info_provider.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/wm_info_provider.rs')
-rw-r--r--src/wm_info_provider.rs30
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)]