VirtualBox

Ignore:
Timestamp:
Oct 30, 2007 12:57:20 PM (17 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
25823
Message:

Windows host/guest clipboard fix.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/WINNT/VBoxService/VBoxClipboard.cpp

    r4711 r5558  
    3939//    uint64_t u64LastSentCRC64;
    4040   
    41     volatile uint32_t u32Announcing;
    42 
    4341} VBOXCLIPBOARDCONTEXT;
    4442
     
    336334            dprintf (("vboxClipboardProcessMsg: WM_DRAWCLIPBOARD, hwnd %p\n", pCtx->hwnd));
    337335
    338             if (ASMAtomicCmpXchgU32 (&pCtx->u32Announcing, 0, 1) == false)
    339             {
    340                 /* Could not do 1->0 transition. That means u32Announcing is 0. */
     336            if (GetClipboardOwner () != hwnd)
     337            {
     338                /* Clipboard was updated by another application. */
    341339                vboxClipboardChanged (pCtx);
    342340            }
     
    532530                    dprintf(("window proc WM_USER: VBOX_SHARED_CLIPBOARD_FMT_UNICODETEXT\n"));
    533531                   
    534                     /* Prevent the WM_DRAWCLIPBOARD processing. Will be reset in WM_DRAWCLIPBOARD. */
    535                     if (ASMAtomicCmpXchgU32 (&pCtx->u32Announcing, 1, 0) == true)
    536                     {
    537                         hClip = SetClipboardData (CF_UNICODETEXT, NULL);
    538                     }
     532                    hClip = SetClipboardData (CF_UNICODETEXT, NULL);
    539533                }
    540534
     
    543537                    dprintf(("window proc WM_USER: VBOX_SHARED_CLIPBOARD_FMT_BITMAP\n"));
    544538                   
    545                     /* Prevent the WM_DRAWCLIPBOARD processing. Will be reset in WM_DRAWCLIPBOARD. */
    546                     if (ASMAtomicCmpXchgU32 (&pCtx->u32Announcing, 1, 0) == true)
    547                     {
    548                         hClip = SetClipboardData (CF_DIB, NULL);
    549                     }
     539                    hClip = SetClipboardData (CF_DIB, NULL);
    550540                }
    551541
     
    556546                    if (format != 0)
    557547                    {
    558                         /* Prevent the WM_DRAWCLIPBOARD processing. Will be reset in WM_DRAWCLIPBOARD. */
    559                         if (ASMAtomicCmpXchgU32 (&pCtx->u32Announcing, 1, 0) == true)
    560                         {
    561                             hClip = SetClipboardData (format, NULL);
    562                         }
     548                        hClip = SetClipboardData (format, NULL);
    563549                    }
    564550                }
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