Merge pull request #1663 from zed-industries/terminal-bugs

Mikayla Maki created

A few small bug fixes

Change summary

crates/terminal/src/terminal_element.rs | 16 +++++++++-------
crates/workspace/src/pane.rs            |  1 +
2 files changed, 10 insertions(+), 7 deletions(-)

Detailed changes

crates/terminal/src/terminal_element.rs 🔗

@@ -453,13 +453,15 @@ impl TerminalElement {
                     }
                 }
             })
-            .on_scroll(TerminalElement::generic_button_handler(
-                connection,
-                origin,
-                move |terminal, origin, e, _cx| {
-                    terminal.scroll_wheel(e, origin);
-                },
-            ));
+            .on_scroll(move |event, cx| {
+                // cx.focus_parent_view();
+                if let Some(conn_handle) = connection.upgrade(cx.app) {
+                    conn_handle.update(cx.app, |terminal, cx| {
+                        terminal.scroll_wheel(event, origin);
+                        cx.notify();
+                    })
+                }
+            });
 
         // Mouse mode handlers:
         // All mouse modes need the extra click handlers

crates/workspace/src/pane.rs 🔗

@@ -1493,6 +1493,7 @@ impl View for Pane {
                 .last_focused_view
                 .as_ref()
                 .and_then(|handle| handle.upgrade(cx))
+                .filter(|handle| handle.id() != self.tab_bar_context_menu.id())
             {
                 cx.focus(last_focused_view);
             } else {