mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-01 07:28:30 +00:00
wayland: Check the origin of clipboard offers before forwarding them to the client
Wayland compositors may send recursive clipboard offers to the client, which need to be filtered out to avoid clearing local data. Previously this was worked around with a hack, but this caused the ownership flag to be set incorrectly, which broke some clients. This introduces a metadata MIME type of application/x-sdl3-source-id to be sent with SDL3 selection offers, which contains a string that is a unique identifier for the instance, and can be used to detect if a received selection offer is originating from the same instance that generated it. If DBus is available, the unique identifier string is the unique name of the connection, otherwise, the process ID is used.
This commit is contained in:
@@ -47,6 +47,7 @@ typedef struct SDL_DBusContext
|
||||
dbus_bool_t (*bus_register)(DBusConnection *, DBusError *);
|
||||
void (*bus_add_match)(DBusConnection *, const char *, DBusError *);
|
||||
void (*bus_remove_match)(DBusConnection *, const char *, DBusError *);
|
||||
const char *(*bus_get_unique_name)(DBusConnection *);
|
||||
DBusConnection *(*connection_open_private)(const char *, DBusError *);
|
||||
void (*connection_set_exit_on_disconnect)(DBusConnection *, dbus_bool_t);
|
||||
dbus_bool_t (*connection_get_is_connected)(DBusConnection *);
|
||||
|
Reference in New Issue
Block a user