Removed SDL_EVENT_CLIPBOARD_CANCELLED in favor of the cleanup callback

This commit is contained in:
Sam Lantinga
2023-07-04 12:03:35 -07:00
parent 443868143c
commit c980ce2120
6 changed files with 2 additions and 32 deletions

View File

@@ -35,23 +35,6 @@ int SDL_SendClipboardUpdate(void)
SDL_Event event;
event.type = SDL_EVENT_CLIPBOARD_UPDATE;
event.clipboard.timestamp = 0;
event.clipboard.userdata = NULL;
posted = (SDL_PushEvent(&event) > 0);
}
return posted;
}
int SDL_SendClipboardCancelled(void *userdata)
{
int posted;
/* Post the event, if desired */
posted = 0;
if (SDL_EventEnabled(SDL_EVENT_CLIPBOARD_CANCELLED)) {
SDL_Event event;
event.type = SDL_EVENT_CLIPBOARD_CANCELLED;
event.clipboard.timestamp = 0;
event.clipboard.userdata = userdata;
posted = (SDL_PushEvent(&event) > 0);
}
return posted;

View File

@@ -24,6 +24,5 @@
#define SDL_clipboardevents_c_h_
extern int SDL_SendClipboardUpdate(void);
extern int SDL_SendClipboardCancelled(void *userdata);
#endif /* SDL_clipboardevents_c_h_ */

View File

@@ -210,8 +210,6 @@ static void SDL_LogEvent(const SDL_Event *event)
break;
SDL_EVENT_CASE(SDL_EVENT_CLIPBOARD_UPDATE)
break;
SDL_EVENT_CASE(SDL_EVENT_CLIPBOARD_CANCELLED)
break;
SDL_EVENT_CASE(SDL_EVENT_RENDER_TARGETS_RESET)
break;
SDL_EVENT_CASE(SDL_EVENT_RENDER_DEVICE_RESET)

View File

@@ -1757,9 +1757,6 @@ static void SDLTest_PrintEvent(SDL_Event *event)
case SDL_EVENT_CLIPBOARD_UPDATE:
SDL_Log("SDL EVENT: Clipboard updated");
break;
case SDL_EVENT_CLIPBOARD_CANCELLED:
SDL_Log("SDL EVENT: Clipboard ownership canceled");
break;
case SDL_EVENT_FINGER_MOTION:
SDL_Log("SDL EVENT: Finger: motion touch=%ld, finger=%ld, x=%f, y=%f, dx=%f, dy=%f, pressure=%f",

View File

@@ -35,8 +35,6 @@ void SDL_CancelClipboardData(Uint32 sequence)
return;
}
SDL_SendClipboardCancelled(_this->clipboard_userdata);
if (_this->clipboard_cleanup) {
_this->clipboard_cleanup(_this->clipboard_userdata);
}