user32/tests: Protect OpenClipboard() from interference.
commit316eec8f6658a3776d3ae147baf5ade11e536116
authorFrancois Gouget <fgouget@codeweavers.com>
Fri, 4 Jun 2021 12:39:09 +0000 (4 14:39 +0200)
committerAlexandre Julliard <julliard@winehq.org>
Fri, 4 Jun 2021 18:00:30 +0000 (4 20:00 +0200)
tree52d09acdb485bead3eb073d144a7d3f0744df86e
parent001b70774f70ddcf2b956d2264201780e2c622d5
user32/tests: Protect OpenClipboard() from interference.

Applications using ole32's clipboard API (e.g. Radeon / QT5) end up
monitoring the content of the clipboard and calling OpenClipboard()
while user32:clipboard runs. This causes the test's own
OpenClipboard() calls to fail.
Similarly the KDE clipboard manager may query the Wine clipboard
content while the test runs, causing winex11.drv to call
OpenClipboard() with the same effect.
So call OpenClipboard() again when it fails due to the clipboard
already being open. If opening the clipboard still fails, trace who
opened the clipboard, particularly the window class name to help
identify the source of interference.

Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
dlls/user32/tests/clipboard.c