aboutsummaryrefslogtreecommitdiffstats
path: root/zellij-server/src
diff options
context:
space:
mode:
authorAram Drevekenin <aram@poor.dev>2024-10-11 18:04:18 +0200
committerGitHub <noreply@github.com>2024-10-11 18:04:18 +0200
commit2bd0f2a535433c99ef7f131a0d3b4b2046235c91 (patch)
treea09456d13650451e58a5464cae993f6b259053aa /zellij-server/src
parentdocs(changelog): concurrent http plugin downloads (diff)
downloadsl0ppij-2bd0f2a535433c99ef7f131a0d3b4b2046235c91.tar.gz
sl0ppij-2bd0f2a535433c99ef7f131a0d3b4b2046235c91.tar.xz
sl0ppij-2bd0f2a535433c99ef7f131a0d3b4b2046235c91.zip
fix(plugins): various plugin api and other fixes (#3665)
* fix(plugins): do not allow focusing an unselectable pane * fix(folders): make sure config and cache folders exist on app start
Diffstat (limited to 'zellij-server/src')
-rw-r--r--zellij-server/src/panes/floating_panes/mod.rs9
-rw-r--r--zellij-server/src/panes/tiled_panes/mod.rs9
-rw-r--r--zellij-server/src/tab/mod.rs3
3 files changed, 20 insertions, 1 deletions
diff --git a/zellij-server/src/panes/floating_panes/mod.rs b/zellij-server/src/panes/floating_panes/mod.rs
index 1d65e749..e896364b 100644
--- a/zellij-server/src/panes/floating_panes/mod.rs
+++ b/zellij-server/src/panes/floating_panes/mod.rs
@@ -712,6 +712,15 @@ impl FloatingPanes {
self.set_force_render();
}
pub fn focus_pane(&mut self, pane_id: PaneId, client_id: ClientId) {
+ let pane_is_selectable = self
+ .panes
+ .get(&pane_id)
+ .map(|p| p.selectable())
+ .unwrap_or(false);
+ if !pane_is_selectable {
+ log::error!("Cannot focus pane {:?} as it is not selectable!", pane_id);
+ return;
+ }
self.active_panes
.insert(client_id, pane_id, &mut self.panes);
self.focus_pane_for_all_clients(pane_id);
diff --git a/zellij-server/src/panes/tiled_panes/mod.rs b/zellij-server/src/panes/tiled_panes/mod.rs
index 931e2594..fba9ea21 100644
--- a/zellij-server/src/panes/tiled_panes/mod.rs
+++ b/zellij-server/src/panes/tiled_panes/mod.rs
@@ -524,6 +524,15 @@ impl TiledPanes {
}
}
pub fn focus_pane(&mut self, pane_id: PaneId, client_id: ClientId) {
+ let pane_is_selectable = self
+ .panes
+ .get(&pane_id)
+ .map(|p| p.selectable())
+ .unwrap_or(false);
+ if !pane_is_selectable {
+ log::error!("Cannot focus pane {:?} as it is not selectable!", pane_id);
+ return;
+ }
if self.panes_to_hide.contains(&pane_id) {
// this means there is a fullscreen pane that is not the current pane, let's unset it
// before changing focus
diff --git a/zellij-server/src/tab/mod.rs b/zellij-server/src/tab/mod.rs
index df69e985..4c5c2075 100644
--- a/zellij-server/src/tab/mod.rs
+++ b/zellij-server/src/tab/mod.rs
@@ -4105,7 +4105,8 @@ impl Tab {
focused_floating_pane
})
.or_else(|_| match self.suppressed_panes.remove(&pane_id) {
- Some(pane) => {
+ Some(mut pane) => {
+ pane.1.set_selectable(true);
if should_float {
self.show_floating_panes();
self.add_floating_pane(pane.1, pane_id, None, Some(client_id))