summaryrefslogtreecommitdiffstats
path: root/zellij-server/src/screen.rs
diff options
context:
space:
mode:
Diffstat (limited to 'zellij-server/src/screen.rs')
-rw-r--r--zellij-server/src/screen.rs54
1 files changed, 46 insertions, 8 deletions
diff --git a/zellij-server/src/screen.rs b/zellij-server/src/screen.rs
index c184e29fb..deba6eb9c 100644
--- a/zellij-server/src/screen.rs
+++ b/zellij-server/src/screen.rs
@@ -123,8 +123,13 @@ pub enum ScreenInstruction {
ChangeMode(ModeInfo, ClientId),
LeftClick(Position, ClientId),
RightClick(Position, ClientId),
- MouseRelease(Position, ClientId),
- MouseHold(Position, ClientId),
+ MiddleClick(Position, ClientId),
+ LeftMouseRelease(Position, ClientId),
+ RightMouseRelease(Position, ClientId),
+ MiddleMouseRelease(Position, ClientId),
+ MouseHoldLeft(Position, ClientId),
+ MouseHoldRight(Position, ClientId),
+ MouseHoldMiddle(Position, ClientId),
Copy(ClientId),
AddClient(ClientId),
RemoveClient(ClientId),
@@ -222,8 +227,13 @@ impl From<&ScreenInstruction> for ScreenContext {
ScreenInstruction::ScrollDownAt(..) => ScreenContext::ScrollDownAt,
ScreenInstruction::LeftClick(..) => ScreenContext::LeftClick,
ScreenInstruction::RightClick(..) => ScreenContext::RightClick,
- ScreenInstruction::MouseRelease(..) => ScreenContext::MouseRelease,
- ScreenInstruction::MouseHold(..) => ScreenContext::MouseHold,
+ ScreenInstruction::MiddleClick(..) => ScreenContext::MiddleClick,
+ ScreenInstruction::LeftMouseRelease(..) => ScreenContext::LeftMouseRelease,
+ ScreenInstruction::RightMouseRelease(..) => ScreenContext::RightMouseRelease,
+ ScreenInstruction::MiddleMouseRelease(..) => ScreenContext::MiddleMouseRelease,
+ ScreenInstruction::MouseHoldLeft(..) => ScreenContext::MouseHoldLeft,
+ ScreenInstruction::MouseHoldRight(..) => ScreenContext::MouseHoldRight,
+ ScreenInstruction::MouseHoldMiddle(..) => ScreenContext::MouseHoldMiddle,
ScreenInstruction::Copy(..) => ScreenContext::Copy,
ScreenInstruction::ToggleTab(..) => ScreenContext::ToggleTab,
ScreenInstruction::AddClient(..) => ScreenContext::AddClient,
@@ -1303,14 +1313,42 @@ pub(crate) fn screen_thread_main(
screen.update_tabs();
screen.render();
},
- ScreenInstruction::MouseRelease(point, client_id) => {
+ ScreenInstruction::MiddleClick(point, client_id) => {
active_tab!(screen, client_id, |tab: &mut Tab| tab
- .handle_mouse_release(&point, client_id));
+ .handle_middle_click(&point, client_id));
+ screen.update_tabs();
+ screen.render();
+ },
+ ScreenInstruction::LeftMouseRelease(point, client_id) => {
+ active_tab!(screen, client_id, |tab: &mut Tab| tab
+ .handle_left_mouse_release(&point, client_id));
+ screen.render();
+ },
+ ScreenInstruction::RightMouseRelease(point, client_id) => {
+ active_tab!(screen, client_id, |tab: &mut Tab| tab
+ .handle_right_mouse_release(&point, client_id));
+ screen.render();
+ },
+ ScreenInstruction::MiddleMouseRelease(point, client_id) => {
+ active_tab!(screen, client_id, |tab: &mut Tab| tab
+ .handle_middle_mouse_release(&point, client_id));
+ screen.render();
+ },
+ ScreenInstruction::MouseHoldLeft(point, client_id) => {
+ active_tab!(screen, client_id, |tab: &mut Tab| {
+ tab.handle_mouse_hold_left(&point, client_id);
+ });
+ screen.render();
+ },
+ ScreenInstruction::MouseHoldRight(point, client_id) => {
+ active_tab!(screen, client_id, |tab: &mut Tab| {
+ tab.handle_mouse_hold_right(&point, client_id);
+ });
screen.render();
},
- ScreenInstruction::MouseHold(point, client_id) => {
+ ScreenInstruction::MouseHoldMiddle(point, client_id) => {
active_tab!(screen, client_id, |tab: &mut Tab| {
- tab.handle_mouse_hold(&point, client_id);
+ tab.handle_mouse_hold_middle(&point, client_id);
});
screen.render();
},