mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-15 14:26:01 +00:00
Get the initial clipboard state at startup
This commit is contained in:
@@ -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;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user