21 #include "../../SDL_internal.h" 23 #if SDL_VIDEO_DRIVER_X11 25 #include <sys/types.h> 34 #include "../../events/SDL_events_c.h" 35 #include "../../events/SDL_mouse_c.h" 36 #include "../../events/SDL_touch_c.h" 45 #ifndef _NET_WM_MOVERESIZE_SIZE_TOPLEFT 46 #define _NET_WM_MOVERESIZE_SIZE_TOPLEFT 0 49 #ifndef _NET_WM_MOVERESIZE_SIZE_TOP 50 #define _NET_WM_MOVERESIZE_SIZE_TOP 1 53 #ifndef _NET_WM_MOVERESIZE_SIZE_TOPRIGHT 54 #define _NET_WM_MOVERESIZE_SIZE_TOPRIGHT 2 57 #ifndef _NET_WM_MOVERESIZE_SIZE_RIGHT 58 #define _NET_WM_MOVERESIZE_SIZE_RIGHT 3 61 #ifndef _NET_WM_MOVERESIZE_SIZE_BOTTOMRIGHT 62 #define _NET_WM_MOVERESIZE_SIZE_BOTTOMRIGHT 4 65 #ifndef _NET_WM_MOVERESIZE_SIZE_BOTTOM 66 #define _NET_WM_MOVERESIZE_SIZE_BOTTOM 5 69 #ifndef _NET_WM_MOVERESIZE_SIZE_BOTTOMLEFT 70 #define _NET_WM_MOVERESIZE_SIZE_BOTTOMLEFT 6 73 #ifndef _NET_WM_MOVERESIZE_SIZE_LEFT 74 #define _NET_WM_MOVERESIZE_SIZE_LEFT 7 77 #ifndef _NET_WM_MOVERESIZE_MOVE 78 #define _NET_WM_MOVERESIZE_MOVE 8 90 static void X11_ReadProperty(SDL_x11Prop *
p, Display *disp, Window
w, Atom prop)
92 unsigned char *ret=
NULL;
96 unsigned long bytes_left;
100 if (ret != 0) X11_XFree(ret);
101 X11_XGetWindowProperty(disp, w, prop, 0, bytes_fetch, False, AnyPropertyType, &type, &fmt, &count, &bytes_left, &ret);
102 bytes_fetch += bytes_left;
103 }
while (bytes_left != 0);
113 static Atom X11_PickTarget(Display *disp, Atom list[],
int list_count)
118 for (i=0; i < list_count && request == None; i++) {
119 name = X11_XGetAtomName(disp, list[i]);
120 if (strcmp(
"text/uri-list", name)==0) request = list[
i];
128 static Atom X11_PickTargetFromAtoms(Display *disp, Atom a0, Atom a1, Atom a2)
132 if (a0 != None) atom[count++] = a0;
133 if (a1 != None) atom[count++] = a1;
134 if (a2 != None) atom[count++] = a2;
135 return X11_PickTarget(disp, atom, count);
138 struct KeyRepeatCheckData
144 static Bool X11_KeyRepeatCheckIfEvent(Display *display, XEvent *chkev,
147 struct KeyRepeatCheckData *
d = (
struct KeyRepeatCheckData *) arg;
148 if (chkev->type == KeyPress &&
149 chkev->xkey.keycode == d->event->xkey.keycode &&
150 chkev->xkey.time - d->event->xkey.time < 2)
158 static SDL_bool X11_KeyRepeat(Display *display, XEvent *
event)
161 struct KeyRepeatCheckData d;
164 if (X11_XPending(display))
165 X11_XCheckIfEvent(display, &dummyev, X11_KeyRepeatCheckIfEvent,
171 X11_IsWheelEvent(Display * display,XEvent * event,
int * xticks,
int * yticks)
178 switch (event->xbutton.button) {
179 case 4: *yticks = 1;
return SDL_TRUE;
180 case 5: *yticks = -1;
return SDL_TRUE;
181 case 6: *xticks = 1;
return SDL_TRUE;
182 case 7: *xticks = -1;
return SDL_TRUE;
201 int X11_URIDecode(
char *
buf,
int len) {
204 if (buf ==
NULL || len < 0) {
211 for (ri = 0, wi = 0, di = 0; ri < len && wi <
len; ri += 1) {
214 if (buf[ri] ==
'%') {
223 }
else if (di == 1 || di == 2) {
225 char isa = buf[ri] >=
'a' && buf[ri] <=
'f';
226 char isA = buf[ri] >=
'A' && buf[ri] <=
'F';
227 char isn = buf[ri] >=
'0' && buf[ri] <=
'9';
228 if (!(isa || isA || isn)) {
231 for (sri = ri - di; sri <= ri; sri += 1) {
246 decode |= (buf[ri] + off) << (2 - di) * 4;
264 static char* X11_URIToLocal(
char* uri) {
268 if (memcmp(uri,
"file:/",6) == 0) uri += 6;
269 else if (strstr(uri,
":/") !=
NULL)
return file;
271 local = uri[0] !=
'/' || (uri[0] !=
'\0' && uri[1] ==
'/');
274 if (!local && uri[0] ==
'/' && uri[2] !=
'/') {
275 char* hostname_end = strchr(uri+1,
'/');
276 if (hostname_end !=
NULL) {
277 char hostname[ 257 ];
278 if (gethostname(hostname, 255) == 0) {
279 hostname[ 256 ] =
'\0';
280 if (memcmp(uri+1, hostname, hostname_end - (uri+1)) == 0) {
281 uri = hostname_end + 1;
290 X11_URIDecode(file, 0);
300 #if SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS 301 static void X11_HandleGenericEvent(
SDL_VideoData *videodata,XEvent event)
305 if (X11_XGetEventData(videodata->
display, cookie)) {
307 X11_XFreeEventData(videodata->
display, cookie);
313 X11_GetNumLockModifierMask(
_THIS)
316 Display *display = viddata->
display;
317 unsigned num_mask = 0;
319 XModifierKeymap *xmods;
322 xmods = X11_XGetModifierMapping(display);
323 n = xmods->max_keypermod;
324 for(i = 3; i < 8; i++) {
325 for(
j = 0;
j <
n;
j++) {
326 KeyCode kc = xmods->modifiermap[i * n +
j];
333 X11_XFreeModifiermap(xmods);
339 X11_ReconcileKeyboardState(
_THIS)
342 Display *display = viddata->
display;
349 X11_XQueryKeymap(display, keys);
352 if (X11_XQueryPointer(display, DefaultRootWindow(display), &junk_window, &junk_window, &x, &
y, &x, &
y, &
mask)) {
357 for (keycode = 0; keycode < 256; ++keycode) {
358 if (keys[keycode / 8] & (1 << (keycode % 8))) {
371 printf(
"window %p: Dispatching FocusIn\n", data);
374 X11_ReconcileKeyboardState(
_this);
375 #ifdef X_HAVE_UTF8_STRING 377 X11_XSetICFocus(data->
ic);
389 printf(
"window %p: Dispatching FocusOut\n", data);
398 #ifdef X_HAVE_UTF8_STRING 400 X11_XUnsetICFocus(data->
ic);
427 Display *display = viddata->
display;
431 X11_XUngrabPointer(display, 0L);
434 evt.xclient.type = ClientMessage;
435 evt.xclient.window = data->
xwindow;
436 evt.xclient.message_type = X11_XInternAtom(display,
"_NET_WM_MOVERESIZE", True);
437 evt.xclient.format = 32;
438 evt.xclient.data.l[0] =
window->
x + point->
x;
439 evt.xclient.data.l[1] =
window->
y + point->
y;
440 evt.xclient.data.l[2] = _NET_WM_MOVERESIZE_MOVE;
441 evt.xclient.data.l[3] = Button1;
442 evt.xclient.data.l[4] = 0;
443 X11_XSendEvent(display, DefaultRootWindow(display), False, SubstructureRedirectMask | SubstructureNotifyMask, &evt);
445 X11_XSync(display, 0);
453 Display *display = viddata->
display;
456 if (direction < _NET_WM_MOVERESIZE_SIZE_TOPLEFT || direction > _NET_WM_MOVERESIZE_SIZE_LEFT)
460 X11_XUngrabPointer(display, 0L);
463 evt.xclient.type = ClientMessage;
464 evt.xclient.window = data->
xwindow;
465 evt.xclient.message_type = X11_XInternAtom(display,
"_NET_WM_MOVERESIZE", True);
466 evt.xclient.format = 32;
467 evt.xclient.data.l[0] =
window->
x + point->
x;
468 evt.xclient.data.l[1] =
window->
y + point->
y;
469 evt.xclient.data.l[2] = direction;
470 evt.xclient.data.l[3] = Button1;
471 evt.xclient.data.l[4] = 0;
472 X11_XSendEvent(display, DefaultRootWindow(display), False, SubstructureRedirectMask | SubstructureNotifyMask, &evt);
474 X11_XSync(display, 0);
483 const SDL_Point point = { xev->xbutton.
x, xev->xbutton.y };
485 static const int directions[] = {
486 _NET_WM_MOVERESIZE_SIZE_TOPLEFT, _NET_WM_MOVERESIZE_SIZE_TOP,
487 _NET_WM_MOVERESIZE_SIZE_TOPRIGHT, _NET_WM_MOVERESIZE_SIZE_RIGHT,
488 _NET_WM_MOVERESIZE_SIZE_BOTTOMRIGHT, _NET_WM_MOVERESIZE_SIZE_BOTTOM,
489 _NET_WM_MOVERESIZE_SIZE_BOTTOMLEFT, _NET_WM_MOVERESIZE_SIZE_LEFT
494 InitiateWindowMove(
_this, data, &point);
516 X11_DispatchEvent(
_THIS)
519 Display *display = videodata->
display;
523 KeyCode orig_keycode;
524 XClientMessageEvent
m;
528 X11_XNextEvent(display, &xevent);
533 orig_event_type = xevent.type;
534 if (orig_event_type == KeyPress || orig_event_type == KeyRelease) {
535 orig_keycode = xevent.xkey.keycode;
541 if (X11_XFilterEvent(&xevent, None) == True) {
543 printf(
"Filtered event type = %d display = %d window = %d\n",
544 xevent.type, xevent.xany.display, xevent.xany.window);
567 wmmsg.
msg.
x11.event = xevent;
571 #if SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS 572 if(xevent.type == GenericEvent) {
573 X11_HandleGenericEvent(videodata,xevent);
579 printf(
"type = %d display = %d window = %d\n",
580 xevent.type, xevent.xany.display, xevent.xany.window);
595 if (xevent.type == KeymapNotify) {
597 X11_ReconcileKeyboardState(
_this);
599 }
else if (xevent.type == MappingNotify) {
601 const int request = xevent.xmapping.request;
604 printf(
"window %p: MappingNotify!\n", data);
606 if ((request == MappingKeyboard) || (request == MappingModifier)) {
607 X11_XRefreshKeyboardMapping(&xevent.xmapping);
616 switch (xevent.type) {
621 printf(
"window %p: EnterNotify! (%d,%d,%d)\n", data,
624 xevent.xcrossing.mode);
625 if (xevent.xcrossing.mode == NotifyGrab)
626 printf(
"Mode: NotifyGrab\n");
627 if (xevent.xcrossing.mode == NotifyUngrab)
628 printf(
"Mode: NotifyUngrab\n");
640 printf(
"window %p: LeaveNotify! (%d,%d,%d)\n", data,
643 xevent.xcrossing.mode);
644 if (xevent.xcrossing.mode == NotifyGrab)
645 printf(
"Mode: NotifyGrab\n");
646 if (xevent.xcrossing.mode == NotifyUngrab)
647 printf(
"Mode: NotifyUngrab\n");
653 if (xevent.xcrossing.mode != NotifyGrab &&
654 xevent.xcrossing.mode != NotifyUngrab &&
655 xevent.xcrossing.detail != NotifyInferior) {
663 if (xevent.xfocus.mode == NotifyGrab || xevent.xfocus.mode == NotifyUngrab) {
666 printf(
"window %p: FocusIn (NotifyGrab/NotifyUngrab, ignoring)\n", data);
671 if (xevent.xfocus.detail == NotifyInferior) {
673 printf(
"window %p: FocusIn (NotifierInferior, ignoring)\n", data);
678 printf(
"window %p: FocusIn!\n", data);
684 X11_DispatchFocusIn(
_this, data);
696 if (xevent.xfocus.mode == NotifyGrab || xevent.xfocus.mode == NotifyUngrab) {
699 printf(
"window %p: FocusOut (NotifyGrab/NotifyUngrab, ignoring)\n", data);
703 if (xevent.xfocus.detail == NotifyInferior) {
706 printf(
"window %p: FocusOut (NotifierInferior, ignoring)\n", data);
711 printf(
"window %p: FocusOut!\n", data);
717 X11_DispatchFocusOut(
_this, data);
729 KeyCode keycode = xevent.xkey.keycode;
730 KeySym keysym = NoSymbol;
736 printf(
"window %p: KeyPress (X11 keycode = 0x%X)\n", data, xevent.xkey.keycode);
740 int min_keycode, max_keycode;
741 X11_XDisplayKeycodes(display, &min_keycode, &max_keycode);
742 #if SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM 743 keysym = X11_XkbKeycodeToKeysym(display, keycode, 0, 0);
745 keysym = X11_XKeycodeToKeysym(display, keycode, 0);
748 "The key you just pressed is not recognized by SDL. To help get this fixed, please report this to the SDL mailing list <sdl@libsdl.org> X11 KeyCode %d (%d), X11 KeySym 0x%lX (%s).\n",
749 keycode, keycode - min_keycode, keysym,
750 X11_XKeysymToString(keysym));
755 #ifdef X_HAVE_UTF8_STRING 757 X11_Xutf8LookupString(data->
ic, &xevent.xkey, text,
sizeof(text),
761 X11_XLookupString(&xevent.xkey, text,
sizeof(text), &keysym,
NULL);
766 handled_by_ime = SDL_IBus_ProcessKeyEvent(keysym, keycode);
769 if (!handled_by_ime) {
781 KeyCode keycode = xevent.xkey.keycode;
784 printf(
"window %p: KeyRelease (X11 keycode = 0x%X)\n", data, xevent.xkey.keycode);
786 if (X11_KeyRepeat(display, &xevent)) {
797 printf(
"window %p: UnmapNotify!\n", data);
799 X11_DispatchUnmapNotify(data);
806 printf(
"window %p: MapNotify!\n", data);
808 X11_DispatchMapNotify(data);
813 case ConfigureNotify:{
815 printf(
"window %p: ConfigureNotify! (position: %d,%d, size: %dx%d)\n", data,
816 xevent.xconfigure.x, xevent.xconfigure.y,
817 xevent.xconfigure.width, xevent.xconfigure.height);
819 long border_left = 0;
822 Atom _net_frame_extents = X11_XInternAtom(display,
"_NET_FRAME_EXTENTS", 0);
825 unsigned long nitems, bytes_after;
826 unsigned char *property;
827 if (X11_XGetWindowProperty(display, data->
xwindow,
828 _net_frame_extents, 0, 16, 0,
829 XA_CARDINAL, &type, &format,
830 &nitems, &bytes_after, &property) == Success) {
831 if (type != None && nitems == 4)
833 border_left = ((
long*)property)[0];
834 border_top = ((
long*)property)[2];
843 xevent.xconfigure.x - border_left,
844 xevent.xconfigure.y - border_top);
848 SDL_IBus_UpdateTextRect(
NULL);
855 xevent.xconfigure.width,
856 xevent.xconfigure.height);
865 static int xdnd_version=0;
867 if (xevent.xclient.message_type == videodata->
XdndEnter) {
869 SDL_bool use_list = xevent.xclient.data.l[1] & 1;
871 xdnd_version = (xevent.xclient.data.l[1] >> 24);
873 printf(
"XID of source window : %ld\n", data->
xdnd_source);
874 printf(
"Protocol version to use : %d\n", xdnd_version);
875 printf(
"More then 3 data types : %d\n", (
int) use_list);
883 data->
xdnd_req = X11_PickTarget(display, (Atom*)p.data, p.count);
887 data->
xdnd_req = X11_PickTargetFromAtoms(display, xevent.xclient.data.l[2], xevent.xclient.data.l[3], xevent.xclient.data.l[4]);
890 else if (xevent.xclient.message_type == videodata->
XdndPosition) {
894 if(xdnd_version >= 2) {
895 act = xevent.xclient.data.l[4];
897 printf(
"Action requested by user is : %s\n", X11_XGetAtomName(display , act));
902 memset(&
m, 0,
sizeof(XClientMessageEvent));
903 m.type = ClientMessage;
904 m.display = xevent.xclient.display;
905 m.window = xevent.xclient.data.l[0];
914 X11_XSendEvent(display, xevent.xclient.data.l[0], False, NoEventMask, (XEvent*)&
m);
917 else if(xevent.xclient.message_type == videodata->
XdndDrop) {
920 memset(&
m, 0,
sizeof(XClientMessageEvent));
921 m.type = ClientMessage;
922 m.display = xevent.xclient.display;
923 m.window = xevent.xclient.data.l[0];
929 X11_XSendEvent(display, xevent.xclient.data.l[0], False, NoEventMask, (XEvent*)&
m);
932 if(xdnd_version >= 1) {
939 else if ((xevent.xclient.message_type == videodata->
WM_PROTOCOLS) &&
940 (xevent.xclient.format == 32) &&
941 (xevent.xclient.data.l[0] == videodata->
_NET_WM_PING)) {
942 Window root = DefaultRootWindow(display);
945 printf(
"window %p: _NET_WM_PING\n", data);
947 xevent.xclient.window = root;
948 X11_XSendEvent(display, root, False, SubstructureRedirectMask | SubstructureNotifyMask, &xevent);
952 else if ((xevent.xclient.message_type == videodata->
WM_PROTOCOLS) &&
953 (xevent.xclient.format == 32) &&
957 printf(
"window %p: WM_DELETE_WINDOW\n", data);
968 printf(
"window %p: Expose (count = %d)\n", data, xevent.xexpose.count);
978 printf(
"window %p: X11 motion: %d,%d\n", xevent.xmotion.x, xevent.xmotion.y);
987 int xticks = 0, yticks = 0;
988 if (X11_IsWheelEvent(display,&xevent,&xticks, &yticks)) {
991 int button = xevent.xbutton.button;
992 if(button == Button1) {
993 if (ProcessHitTest(
_this, data, &xevent)) {
997 else if(button > 7) {
1007 case ButtonRelease:{
1008 int button = xevent.xbutton.button;
1010 int xticks = 0, yticks = 0;
1011 if (!X11_IsWheelEvent(display,&xevent,&xticks, &yticks)) {
1021 case PropertyNotify:{
1022 #ifdef DEBUG_XEVENTS 1023 unsigned char *propdata;
1024 int status, real_format;
1026 unsigned long items_read, items_left;
1028 char *name = X11_XGetAtomName(display, xevent.xproperty.atom);
1030 printf(
"window %p: PropertyNotify: %s %s\n", data, name, (xevent.xproperty.state == PropertyDelete) ?
"deleted" :
"changed");
1034 status = X11_XGetWindowProperty(display, data->
xwindow, xevent.xproperty.atom, 0L, 8192L, False, AnyPropertyType, &real_type, &real_format, &items_read, &items_left, &propdata);
1035 if (status == Success && items_read > 0) {
1036 if (real_type == XA_INTEGER) {
1037 int *
values = (
int *)propdata;
1040 for (i = 0; i < items_read; i++) {
1041 printf(
" %d", values[i]);
1044 }
else if (real_type == XA_CARDINAL) {
1045 if (real_format == 32) {
1049 for (i = 0; i < items_read; i++) {
1050 printf(
" %d", values[i]);
1053 }
else if (real_format == 16) {
1057 for (i = 0; i < items_read; i++) {
1058 printf(
" %d", values[i]);
1061 }
else if (real_format == 8) {
1065 for (i = 0; i < items_read; i++) {
1066 printf(
" %d", values[i]);
1070 }
else if (real_type == XA_STRING ||
1072 printf(
"{ \"%s\" }\n", propdata);
1073 }
else if (real_type == XA_ATOM) {
1074 Atom *atoms = (Atom *)propdata;
1077 for (i = 0; i < items_read; i++) {
1078 char *atomname = X11_XGetAtomName(display, atoms[i]);
1080 printf(
" %s", atomname);
1081 X11_XFree(atomname);
1086 char *atomname = X11_XGetAtomName(display, real_type);
1087 printf(
"Unknown type: %ld (%s)\n", real_type, atomname ? atomname :
"UNKNOWN");
1089 X11_XFree(atomname);
1093 if (status == Success) {
1094 X11_XFree(propdata);
1108 if (flags & SDL_WINDOW_HIDDEN) {
1109 X11_DispatchUnmapNotify(data);
1111 X11_DispatchMapNotify(data);
1116 if (flags & SDL_WINDOW_MAXIMIZED) {
1136 case SelectionRequest: {
1137 XSelectionRequestEvent *req;
1140 unsigned long nbytes;
1141 unsigned long overflow;
1142 unsigned char *seln_data;
1144 req = &xevent.xselectionrequest;
1145 #ifdef DEBUG_XEVENTS 1146 printf(
"window %p: SelectionRequest (requestor = %ld, target = %ld)\n", data,
1147 req->requestor, req->target);
1151 sevent.xany.type = SelectionNotify;
1152 sevent.xselection.selection = req->selection;
1153 sevent.xselection.target = None;
1154 sevent.xselection.property = None;
1155 sevent.xselection.requestor = req->requestor;
1156 sevent.xselection.time = req->time;
1158 if (X11_XGetWindowProperty(display, DefaultRootWindow(display),
1160 &sevent.xselection.target, &seln_format, &nbytes,
1161 &overflow, &seln_data) == Success) {
1162 Atom XA_TARGETS = X11_XInternAtom(display,
"TARGETS", 0);
1163 if (sevent.xselection.target == req->target) {
1164 X11_XChangeProperty(display, req->requestor, req->property,
1165 sevent.xselection.target, seln_format, PropModeReplace,
1167 sevent.xselection.property = req->property;
1168 }
else if (XA_TARGETS == req->target) {
1169 Atom SupportedFormats[] = { XA_TARGETS, sevent.xselection.target };
1170 X11_XChangeProperty(display, req->requestor, req->property,
1171 XA_ATOM, 32, PropModeReplace,
1172 (
unsigned char*)SupportedFormats,
1174 sevent.xselection.property = req->property;
1175 sevent.xselection.target = XA_TARGETS;
1177 X11_XFree(seln_data);
1179 X11_XSendEvent(display, req->requestor, False, 0, &sevent);
1180 X11_XSync(display, False);
1184 case SelectionNotify: {
1185 #ifdef DEBUG_XEVENTS 1186 printf(
"window %p: SelectionNotify (requestor = %ld, target = %ld)\n", data,
1187 xevent.xselection.requestor, xevent.xselection.target);
1189 Atom
target = xevent.xselection.target;
1193 X11_ReadProperty(&p, display, data->
xwindow, videodata->
PRIMARY);
1195 if (p.format == 8) {
1198 char *scan = (
char*)p.data;
1204 if (*scan == 0x0D) {
1207 if (start ==
NULL) {
1213 if (*scan == 0x0A &&
length > 0) {
1217 fn = X11_URIToLocal(uri);
1234 m.type = ClientMessage;
1235 m.display = display;
1242 X11_XSendEvent(display, data->
xdnd_source, False, NoEventMask, (XEvent*)&
m);
1244 X11_XSync(display, False);
1252 case SelectionClear: {
1253 Atom XA_CLIPBOARD = X11_XInternAtom(display,
"CLIPBOARD", 0);
1255 if (xevent.xselectionclear.selection == XA_PRIMARY ||
1256 (XA_CLIPBOARD != None && xevent.xselectionclear.selection == XA_CLIPBOARD)) {
1263 #ifdef DEBUG_XEVENTS 1264 printf(
"window %p: Unhandled event %d\n", data, xevent.type);
1272 X11_HandleFocusChanges(
_THIS)
1284 X11_DispatchFocusIn(
_this, data);
1286 X11_DispatchFocusOut(
_this, data);
1296 X11_Pending(Display * display)
1299 X11_XFlush(display);
1300 if (X11_XEventsQueued(display, QueuedAlready)) {
1306 static struct timeval zero_time;
1310 x11_fd = ConnectionNumber(display);
1312 FD_SET(x11_fd, &fdset);
1313 if (select(x11_fd + 1, &fdset,
NULL,
NULL, &zero_time) == 1) {
1314 return (X11_XPending(display));
1338 X11_XResetScreenSaver(data->
display);
1341 SDL_DBus_ScreensaverTickle();
1349 while (X11_Pending(data->
display)) {
1350 X11_DispatchEvent(
_this);
1355 SDL_IBus_PumpEvents();
1360 X11_HandleFocusChanges(
_this);
1367 #if SDL_VIDEO_DRIVER_X11_XSCRNSAVER 1370 int major_version, minor_version;
1379 SDL_DBus_ScreensaverTickle();
1383 #if SDL_VIDEO_DRIVER_X11_XSCRNSAVER 1384 if (SDL_X11_HAVE_XSS) {
1386 if (!X11_XScreenSaverQueryExtension(data->
display, &dummy, &dummy) ||
1387 !X11_XScreenSaverQueryVersion(data->
display,
1388 &major_version, &minor_version) ||
1389 major_version < 1 || (major_version == 1 && minor_version < 1)) {
1394 X11_XResetScreenSaver(data->
display);
void X11_PumpEvents(_THIS)
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
SDL_Mouse * SDL_GetMouse(void)
void SDL_SetKeyboardFocus(SDL_Window *window)
Uint32 X11_GetNetWMState(_THIS, Window xwindow)
uint32_t Uint32
An unsigned 32-bit integer type.
GLint GLint GLint GLint GLint x
SDL_bool relative_mode_warp
GLuint GLuint GLsizei count
struct wl_display * display
The structure that defines a point.
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
SDL_WindowData ** windowlist
GLuint const GLchar * name
int SDL_SendWindowEvent(SDL_Window *window, Uint8 windowevent, int data1, int data2)
void SDL_SetMouseFocus(SDL_Window *window)
#define SDL_GetKeyboardFocus
union SDL_SysWMmsg::@16 msg
SDL_bool selection_waiting
int SDL_SendSysWMEvent(SDL_SysWMmsg *message)
int SDL_SendKeyboardKey(Uint8 state, SDL_Scancode scancode)
#define SDL_VERSION(x)
Macro to determine SDL version program was compiled against.
static SDL_VideoDevice * _this
SDL_HitTestResult
Possible return values from the SDL_HitTest callback.
GLuint GLuint GLsizei GLenum type
Uint32 screensaver_activity
Uint32 pending_focus_time
#define SDL_GetEventState(type)
void X11_SuspendScreenSaver(_THIS)
GLint GLint GLint GLint GLint GLint y
int SDL_SendMouseMotion(SDL_Window *window, SDL_MouseID mouseID, int relative, int x, int y)
Uint32 SDL_GetTicks(void)
Get the number of milliseconds since the SDL library initialization.
SDL_PRINTF_FORMAT_STRING const char int SDL_PRINTF_FORMAT_STRING const char int SDL_PRINTF_FORMAT_STRING const char int SDL_PRINTF_FORMAT_STRING const char const char SDL_SCANF_FORMAT_STRING const char return SDL_ThreadFunction const char void return Uint32 return Uint32 SDL_AssertionHandler void SDL_SpinLock SDL_atomic_t int int return SDL_atomic_t return void void void return void return int return SDL_AudioSpec SDL_AudioSpec return int int return return int SDL_RWops int SDL_AudioSpec Uint8 ** d
struct SDL_VideoData * videodata
int SDL_SendClipboardUpdate(void)
uint8_t Uint8
An unsigned 8-bit integer type.
int SDL_SendKeyboardText(const char *text)
GLenum GLsizei GLsizei GLint * values
void X11_UpdateKeymap(_THIS)
GLenum GLuint GLenum GLsizei const GLchar * buf
void SDL_ToggleModState(const SDL_Keymod modstate, const SDL_bool toggle)
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Atom X11_GetSDLCutBufferClipboardType(Display *display)
static char text[MAX_TEXT_LENGTH]
struct SDL_SysWMmsg::@16::@17 x11
int SDL_SendKeymapChangedEvent(void)
int SDL_SendDropFile(const char *file)
#define PENDING_FOCUS_TIME
The type used to identify a window.
uint16_t Uint16
An unsigned 16-bit integer type.
XConfigureEvent last_xconfigure
SDL_bool suspend_screensaver
#define SDL_arraysize(array)
int SDL_SendMouseWheel(SDL_Window *window, SDL_MouseID mouseID, int x, int y, SDL_MouseWheelDirection direction)
#define SDL_TEXTINPUTEVENT_TEXT_SIZE
GLubyte GLubyte GLubyte GLubyte w
Uint32 last_mode_change_deadline
GLuint GLsizei GLsizei * length
#define SDL_TICKS_PASSED(A, B)
Compare SDL ticks values, and return true if A has passed B.
PendingFocusEnum pending_focus
int SDL_SendMouseButton(SDL_Window *window, SDL_MouseID mouseID, Uint8 state, Uint8 button)
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int int in j)