From 9b37b9285e822e83cc1a003000ab24fb4eaa57f1 Mon Sep 17 00:00:00 2001 From: nicm Date: Wed, 2 Apr 2025 09:12:05 +0000 Subject: [PATCH] Popup window should not be draggable while mouse still pressed, and do not try to work out theme if no pane. From Michael Grant in GitHub issue 4330. --- popup.c | 2 +- window.c | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/popup.c b/popup.c index ebe1fc98..be981a39 100644 --- a/popup.c +++ b/popup.c @@ -531,7 +531,7 @@ popup_key_cb(struct client *c, void *data, struct key_event *event) (border == LEFT || border == TOP)) goto menu; if (((m->b & MOUSE_MASK_MODIFIERS) == MOUSE_MASK_META) || - border != NONE) { + (border != NONE && !MOUSE_DRAG(m->lb))) { if (!MOUSE_DRAG(m->b)) goto out; if (MOUSE_BUTTONS(m->lb) == MOUSE_BUTTON_1) diff --git a/window.c b/window.c index b1691ac6..2429d7b7 100644 --- a/window.c +++ b/window.c @@ -1877,11 +1877,15 @@ window_pane_get_fg_control_client(struct window_pane *wp) enum client_theme window_pane_get_theme(struct window_pane *wp) { - struct window *w = wp->window; + struct window *w; struct client *loop; enum client_theme theme; int found_light = 0, found_dark = 0; + if (wp == NULL) + return (THEME_UNKNOWN); + w = wp->window; + /* * Derive theme from pane background color, if it's not the default * colour.