mirror of https://github.com/libsdl-org/SDL.git
Get the initial clipboard state at startup
This commit is contained in:
parent
6575b8157b
commit
54d4e48539
|
|
@ -145,7 +145,7 @@ void Cocoa_CheckClipboardUpdate(SDL_CocoaVideoData *data)
|
||||||
pasteboard = [NSPasteboard generalPasteboard];
|
pasteboard = [NSPasteboard generalPasteboard];
|
||||||
count = [pasteboard changeCount];
|
count = [pasteboard changeCount];
|
||||||
if (count != data.clipboard_count) {
|
if (count != data.clipboard_count) {
|
||||||
if (data.clipboard_count) {
|
if (count) {
|
||||||
int nformats = 0;
|
int nformats = 0;
|
||||||
char **new_mime_types = GetMimeTypes(&nformats);
|
char **new_mime_types = GetMimeTypes(&nformats);
|
||||||
if (new_mime_types) {
|
if (new_mime_types) {
|
||||||
|
|
|
||||||
|
|
@ -426,17 +426,16 @@ static char **GetMimeTypes(int *pnformats)
|
||||||
|
|
||||||
void WIN_CheckClipboardUpdate(struct SDL_VideoData *data)
|
void WIN_CheckClipboardUpdate(struct SDL_VideoData *data)
|
||||||
{
|
{
|
||||||
const DWORD seq = GetClipboardSequenceNumber();
|
DWORD count = GetClipboardSequenceNumber();
|
||||||
if (seq != data->clipboard_count) {
|
if (count != data->clipboard_count) {
|
||||||
if (data->clipboard_count) {
|
if (count) {
|
||||||
int nformats = 0;
|
int nformats = 0;
|
||||||
char **new_mime_types = GetMimeTypes(&nformats);
|
char **new_mime_types = GetMimeTypes(&nformats);
|
||||||
if (new_mime_types) {
|
if (new_mime_types) {
|
||||||
SDL_SendClipboardUpdate(false, new_mime_types, nformats);
|
SDL_SendClipboardUpdate(false, new_mime_types, nformats);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
data->clipboard_count = count;
|
||||||
data->clipboard_count = seq;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue