Skip to content

Commit dac3d6d

Browse files
committed
Shared Clipboard/darwin: Clear the pasteboard in ShClBackendReportFormats() if VBOX_SHCL_FMT_NONE is specified, to match the other backends. bugref:4697
svn:sync-xref-src-repo-rev: r174339
1 parent 18113c1 commit dac3d6d

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

src/VBox/Main/src-client/darwin/ClipboardBackendDarwin.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $Id: ClipboardBackendDarwin.cpp 114383 2026-06-16 10:23:27Z andreas.loeffler@oracle.com $ */
1+
/* $Id: ClipboardBackendDarwin.cpp 114511 2026-06-24 14:57:30Z andreas.loeffler@oracle.com $ */
22
/** @file
33
* Shared Clipboard Service - Mac OS X host.
44
*/
@@ -264,12 +264,13 @@ int ShClBackendReportFormats(PSHCLBACKEND pBackend, PSHCLCLIENT pClient, SHCLFOR
264264

265265
LogFlowFunc(("fFormats=%02X\n", fFormats));
266266

267-
/** @todo r=bird: BUGBUG: The following is probably a mistake. */
268-
/** @todo r=andy: BUGBUG: Has been there since forever; needs investigation first before removing. */
269267
if (fFormats == VBOX_SHCL_FMT_NONE)
270268
{
271-
/* This is just an automatism, not a genuine announcement */
272-
return VINF_SUCCESS;
269+
SHCLCONTEXT *pCtx = pClient->State.pCtx;
270+
RTCritSectEnter(&g_ctx.CritSect);
271+
int vrcClear = clearPasteboard(pCtx->hPasteboard, &pCtx->hStrOwnershipFlavor);
272+
RTCritSectLeave(&g_ctx.CritSect);
273+
return vrcClear;
273274
}
274275

275276
#ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS

0 commit comments

Comments
 (0)