|
@@ -29,6 +29,7 @@
|
|
|
#include "../../events/SDL_touch_c.h"
|
|
|
|
|
|
static int xfixes_initialized = 0;
|
|
|
+static int xfixes_selection_notify_event = 0;
|
|
|
|
|
|
static int query_xfixes_version(Display *display, int major, int minor)
|
|
|
{
|
|
@@ -50,11 +51,20 @@ void X11_InitXfixes(_THIS)
|
|
|
int event, error;
|
|
|
int fixes_opcode;
|
|
|
|
|
|
+ Atom XA_CLIPBOARD = X11_XInternAtom(data->display, "CLIPBOARD", 0);
|
|
|
+
|
|
|
if (!SDL_X11_HAVE_XFIXES ||
|
|
|
!X11_XQueryExtension(data->display, "XFIXES", &fixes_opcode, &event, &error)) {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
+ /* Selection tracking is available in all versions of XFixes */
|
|
|
+ xfixes_selection_notify_event = event + XFixesSelectionNotify;
|
|
|
+ X11_XFixesSelectSelectionInput(data->display, DefaultRootWindow(data->display),
|
|
|
+ XA_CLIPBOARD, XFixesSetSelectionOwnerNotifyMask);
|
|
|
+ X11_XFixesSelectSelectionInput(data->display, DefaultRootWindow(data->display),
|
|
|
+ XA_PRIMARY, XFixesSetSelectionOwnerNotifyMask);
|
|
|
+
|
|
|
/* We need at least 5.0 for barriers. */
|
|
|
version = query_xfixes_version(data->display, 5, 0);
|
|
|
if (!xfixes_version_atleast(version, 5, 0)) {
|
|
@@ -69,6 +79,11 @@ int X11_XfixesIsInitialized()
|
|
|
return xfixes_initialized;
|
|
|
}
|
|
|
|
|
|
+int X11_GetXFixesSelectionNotifyEvent()
|
|
|
+{
|
|
|
+ return xfixes_selection_notify_event;
|
|
|
+}
|
|
|
+
|
|
|
void X11_SetWindowMouseRect(_THIS, SDL_Window *window)
|
|
|
{
|
|
|
if (SDL_RectEmpty(&window->mouse_rect)) {
|