From f054296eb1af4854beb170accfc4df38be9f2a38 Mon Sep 17 00:00:00 2001 From: Ollie Date: Thu, 28 May 2026 21:44:51 +0200 Subject: [PATCH] =?UTF-8?q?textfield:=20always=20re-acquire=20selection=20?= =?UTF-8?q?on=20double-click=20(fix=20Wayland=20paste=E2=86=92stale=20owns?= =?UTF-8?q?Selection)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WINGs/wtextfield.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/WINGs/wtextfield.c b/WINGs/wtextfield.c index 59d8a99..fd60b08 100644 --- a/WINGs/wtextfield.c +++ b/WINGs/wtextfield.c @@ -1541,12 +1541,13 @@ static void handleTextFieldActionEvents(WMEvent * event, void *data) } paintTextField(tPtr); - if (!tPtr->flags.ownsSelection) { - tPtr->flags.ownsSelection = - WMCreateSelectionHandler(tPtr->view, - XA_PRIMARY, - event->u.button.time, &selectionHandler, NULL); - } + /* Always re-acquire on double-click so fresh data is + * pushed on Wayland (selectionLost never fires there). + * Safe on X11 — re-claiming your own selection is a no-op. */ + tPtr->flags.ownsSelection = + WMCreateSelectionHandler(tPtr->view, + XA_PRIMARY, + event->u.button.time, &selectionHandler, NULL); } else if (!tPtr->flags.secure && tPtr->selection.count != 0 && !tPtr->flags.ownsSelection) { tPtr->flags.ownsSelection = WMCreateSelectionHandler(tPtr->view,