From d8aac6fff22d3fe6fb9b9a56e0b5ca89df9715bf Mon Sep 17 00:00:00 2001 From: Matthew Date: Sun, 5 Oct 2025 17:34:41 +1100 Subject: [PATCH] fix for if paste isnt correct format --- platform.d | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/platform.d b/platform.d index 6d0986b..bf00ee1 100644 --- a/platform.d +++ b/platform.d @@ -973,6 +973,9 @@ GetClipboardSelection(PlatformWindow* w, Selection* sel) void RetrieveSelection(PlatformWindow* w, xcb_selection_notify_event_t* ev) { + Lock(&w.cb_mut); + scope(exit) Unlock(&w.cb_mut); + u8[] buf; u64 buf_size; u64 bytes_after = 1; @@ -1032,8 +1035,6 @@ RetrieveSelection(PlatformWindow* w, xcb_selection_notify_event_t* ev) if(buf != null) { - Lock(&w.cb_mut); - Selection* sel; foreach(i; CBM.min .. CBM.max) { @@ -1054,8 +1055,6 @@ RetrieveSelection(PlatformWindow* w, xcb_selection_notify_event_t* ev) { Errf("RetrieveSelection failure: mismatched selection actual_type: %s", actual_type); } - - Unlock(&w.cb_mut); } else {