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.rs27
1 files changed, 20 insertions, 7 deletions
diff --git a/src/wm_info_provider.rs b/src/wm_info_provider.rs
index 12e4fb8..7f2d941 100644
--- a/src/wm_info_provider.rs
+++ b/src/wm_info_provider.rs
@@ -1,3 +1,4 @@
+mod ext_workspace_unstable;
mod river;
use wayrs_client::connection::Connection;
@@ -6,10 +7,13 @@ use wayrs_client::global::*;
use crate::pointer_btn::PointerBtn;
use crate::protocol::*;
use crate::state::State;
+use ext_workspace_unstable::*;
+use river::*;
pub enum WmInfoProvider {
None,
- River(river::RiverInfoProvider),
+ River(RiverInfoProvider),
+ EWU(ExtWorkspaceUnstable),
}
pub type WmInfoCallback = fn(&mut Connection<State>, &mut State, WlOutput, WmInfo);
@@ -20,21 +24,28 @@ impl WmInfoProvider {
globals: &Globals,
callback: WmInfoCallback,
) -> WmInfoProvider {
- let Some(river) = river::RiverInfoProvider::bind(conn, globals, callback) else { return Self::None };
- Self::River(river)
+ if let Some(river) = RiverInfoProvider::bind(conn, globals, callback) {
+ Self::River(river)
+ } else if let Some(ext_wp_u) = ExtWorkspaceUnstable::bind(conn, globals, callback) {
+ Self::EWU(ext_wp_u)
+ } else {
+ Self::None
+ }
}
pub fn new_ouput(&mut self, conn: &mut Connection<State>, output: WlOutput) {
match self {
Self::None => (),
- Self::River(river) => river.new_output(conn, output),
+ Self::River(x) => x.new_output(conn, output),
+ Self::EWU(x) => x.new_ouput(conn, output),
}
}
pub fn output_removed(&mut self, conn: &mut Connection<State>, output: WlOutput) {
match self {
Self::None => (),
- Self::River(river) => river.output_removed(conn, output),
+ Self::River(x) => x.output_removed(conn, output),
+ Self::EWU(x) => x.output_removed(conn, output),
}
}
@@ -48,17 +59,19 @@ impl WmInfoProvider {
) {
match self {
Self::None => (),
- Self::River(river) => river.click_on_tag(conn, output, seat, tag, btn),
+ Self::River(x) => x.click_on_tag(conn, output, seat, tag, btn),
+ Self::EWU(x) => x.click_on_tag(conn, output, seat, tag, btn),
}
}
}
-#[derive(Default)]
+#[derive(Default, Debug)]
pub struct WmInfo {
pub layout_name: Option<String>,
pub tags: Vec<Tag>,
}
+#[derive(Debug)]
pub struct Tag {
pub name: String,
pub is_focused: bool,