diff options
| author | MaxVerevkin <maxxverrr@gmail.com> | 2023-04-17 13:38:20 +0300 |
|---|---|---|
| committer | MaxVerevkin <maxxverrr@gmail.com> | 2023-06-01 13:37:24 +0300 |
| commit | fa9135b5d1a459f91ac47f5c03214d836475473c (patch) | |
| tree | 222c564eefc9991763447691ca1e576f84e69bda | |
| parent | 2da90fc625725c6d3465c920826e2718579cfb40 (diff) | |
| download | i3bar-mango-fa9135b5d1a459f91ac47f5c03214d836475473c.tar.gz | |
ext_workspace_unstable: send activate request
even though it is ignored by hyprland
| -rw-r--r-- | src/pointer_btn.rs | 2 | ||||
| -rw-r--r-- | src/wm_info_provider/ext_workspace_unstable.rs | 17 |
2 files changed, 15 insertions, 4 deletions
diff --git a/src/pointer_btn.rs b/src/pointer_btn.rs index 829fc9c..e5e0722 100644 --- a/src/pointer_btn.rs +++ b/src/pointer_btn.rs @@ -10,7 +10,7 @@ const BTN_FORWARD: u32 = 0x115; const BTN_BACK: u32 = 0x116; // const BTN_TASK: u32 = 0x117; -#[derive(Debug, Clone, Copy)] +#[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum PointerBtn { Left, Middle, diff --git a/src/wm_info_provider/ext_workspace_unstable.rs b/src/wm_info_provider/ext_workspace_unstable.rs index 68238d0..dbf6bf7 100644 --- a/src/wm_info_provider/ext_workspace_unstable.rs +++ b/src/wm_info_provider/ext_workspace_unstable.rs @@ -57,12 +57,23 @@ impl ExtWorkspaceUnstable { pub fn click_on_tag( &mut self, - _: &mut Connection<State>, + conn: &mut Connection<State>, _: WlOutput, _: WlSeat, - _: &str, - _: PointerBtn, + tag: &str, + btn: PointerBtn, ) { + if btn != PointerBtn::Left { + return; + } + + let Some(ws) = self + .groups + .iter() + .find_map(|g| g.workspaces.iter().find(|w| w.name.as_deref() == Some(tag))) + else { return }; + + ws.workspace_handle.activate(conn); } } |
