fix for if paste isnt correct format

This commit is contained in:
Matthew 2025-10-05 17:34:41 +11:00
parent 5a647e49d9
commit d8aac6fff2

View File

@ -973,6 +973,9 @@ GetClipboardSelection(PlatformWindow* w, Selection* sel)
void void
RetrieveSelection(PlatformWindow* w, xcb_selection_notify_event_t* ev) RetrieveSelection(PlatformWindow* w, xcb_selection_notify_event_t* ev)
{ {
Lock(&w.cb_mut);
scope(exit) Unlock(&w.cb_mut);
u8[] buf; u8[] buf;
u64 buf_size; u64 buf_size;
u64 bytes_after = 1; u64 bytes_after = 1;
@ -1032,8 +1035,6 @@ RetrieveSelection(PlatformWindow* w, xcb_selection_notify_event_t* ev)
if(buf != null) if(buf != null)
{ {
Lock(&w.cb_mut);
Selection* sel; Selection* sel;
foreach(i; CBM.min .. CBM.max) 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); Errf("RetrieveSelection failure: mismatched selection actual_type: %s", actual_type);
} }
Unlock(&w.cb_mut);
} }
else else
{ {