VirtualBox

Changeset 5558 in vbox for trunk/src/VBox/HostServices


Ignore:
Timestamp:
Oct 30, 2007 12:57:20 PM (17 years ago)
Author:
vboxsync
Message:

Windows host/guest clipboard fix.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostServices/SharedClipboard/win32.cpp

    r4711 r5558  
    4343   
    4444    VBOXCLIPBOARDCLIENTDATA *pClient;
    45    
    46     volatile uint32_t u32Announcing;
    4745};
    4846
     
    225223            Log(("WM_DRAWCLIPBOARD next %p\n", pCtx->hwndNextInChain));
    226224
    227             if (ASMAtomicCmpXchgU32 (&pCtx->u32Announcing, 0, 1) == false)
    228             {
    229                 /* Could not do 1->0 transition. That means u32Announcing is 0. */
     225            if (GetClipboardOwner () != hwnd)
     226            {
     227                /* Clipboard was updated by another application. */
    230228                vboxClipboardChanged (pCtx);
    231229            }
     
    395393                    dprintf(("window proc WM_USER: VBOX_SHARED_CLIPBOARD_FMT_UNICODETEXT\n"));
    396394                   
    397                     /* Prevent the WM_DRAWCLIPBOARD processing. Will be reset in WM_DRAWCLIPBOARD. */
    398                     if (ASMAtomicCmpXchgU32 (&pCtx->u32Announcing, 1, 0) == true)
    399                     {
    400                         hClip = SetClipboardData (CF_UNICODETEXT, NULL);
    401                     }
     395                    hClip = SetClipboardData (CF_UNICODETEXT, NULL);
    402396                }
    403397
     
    406400                    dprintf(("window proc WM_USER: VBOX_SHARED_CLIPBOARD_FMT_BITMAP\n"));
    407401                   
    408                     /* Prevent the WM_DRAWCLIPBOARD processing. Will be reset in WM_DRAWCLIPBOARD. */
    409                     if (ASMAtomicCmpXchgU32 (&pCtx->u32Announcing, 1, 0) == true)
    410                     {
    411                         hClip = SetClipboardData (CF_DIB, NULL);
    412                     }
     402                    hClip = SetClipboardData (CF_DIB, NULL);
    413403                }
    414404
     
    419409                    if (format != 0)
    420410                    {
    421                         /* Prevent the WM_DRAWCLIPBOARD processing. Will be reset in WM_DRAWCLIPBOARD. */
    422                         if (ASMAtomicCmpXchgU32 (&pCtx->u32Announcing, 1, 0) == true)
    423                         {
    424                             hClip = SetClipboardData (format, NULL);
    425                         }
     411                        hClip = SetClipboardData (format, NULL);
    426412                    }
    427413                }
     
    536522    g_ctx.hRenderEvent = CreateEvent(NULL, TRUE, FALSE, NULL);
    537523   
    538     g_ctx.u32Announcing = 0;
    539    
    540524    rc = RTThreadCreate (&g_ctx.thread, VBoxClipboardThread, NULL, 65536,
    541525                         RTTHREADTYPE_IO, RTTHREADFLAGS_WAITABLE, "SHCLIP");
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette