diff --git a/key-bindings.c b/key-bindings.c index b54fd3c5..3cf6c9b5 100644 --- a/key-bindings.c +++ b/key-bindings.c @@ -60,11 +60,11 @@ " '#{?mouse_hyperlink,Type #[underscore]#{=/9/...:mouse_hyperlink},}' 'C-h' {copy-mode -q; send-keys -l -- \"#{q:mouse_hyperlink}\"}" \ " '#{?mouse_hyperlink,Copy #[underscore]#{=/9/...:mouse_hyperlink},}' 'h' {copy-mode -q; set-buffer -- \"#{q:mouse_hyperlink}\"}" \ " ''" \ - " 'Horizontal Split' 'h' {split-window -h}" \ - " 'Vertical Split' 'v' {split-window -v}" \ + " '#{?#{!:#{pane_floating_flag}},Horizontal Split,}' 'h' {split-window -h}" \ + " '#{?#{!:#{pane_floating_flag}},Vertical Split,}' 'v' {split-window -v}" \ " ''" \ - " '#{?#{>:#{window_panes},1},,-}Swap Up' 'u' {swap-pane -U}" \ - " '#{?#{>:#{window_panes},1},,-}Swap Down' 'd' {swap-pane -D}" \ + " '#{?#{&&:#{!:#{pane_floating_flag}},#{>:#{window_panes},1}},Swap Up,}' 'u' {swap-pane -U}" \ + " '#{?#{&&:#{!:#{pane_floating_flag}},#{>:#{window_panes},1}},Swap Down,}' 'd' {swap-pane -D}" \ " '#{?pane_marked_set,,-}Swap Marked' 's' {swap-pane}" \ " ''" \ " 'Kill' 'X' {kill-pane}" \ diff --git a/server-client.c b/server-client.c index 60169277..c57c3a2c 100644 --- a/server-client.c +++ b/server-client.c @@ -1018,7 +1018,8 @@ have_event: /* Only change pane if not already dragging a pane border. */ if (lwp == NULL) { lwp = wp = window_get_active_at(w, px, py); - c->tty.mouse_last_pane = wp->id; + if (wp != NULL) + c->tty.mouse_last_pane = wp->id; } if (c->tty.mouse_scrolling_flag == 0 && loc == KEYC_MOUSE_LOCATION_SCROLLBAR_SLIDER) {