Port clipboard improvements from inbox to oss (#16670)

#16618 contained a bug which was fixed inbox. This ports the
changes to the OSS repo manually since the two slightly diverged.
This commit is contained in:
Leonard Hecker 2024-02-06 23:50:15 +01:00 committed by GitHub
parent ef96e225da
commit b70fd5e9c6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 0 deletions

View File

@ -358,6 +358,11 @@ void Clipboard::StoreSelectionToClipboard(const bool copyFormatting)
}
const auto clipboard = _openClipboard(ServiceLocator::LocateConsoleWindow()->GetWindowHandle());
if (!clipboard)
{
LOG_LAST_ERROR();
return;
}
EmptyClipboard();
// As per: https://learn.microsoft.com/en-us/windows/win32/dataxchg/standard-clipboard-formats