30 #include <X11/cursorfont.h> 33 #include <sys/select.h> 43 #define _NET_WM_STATE_REMOVE 0 44 #define _NET_WM_STATE_ADD 1 45 #define _NET_WM_STATE_TOGGLE 2 51 #define _GLFW_XDND_VERSION 5 61 const int fd = ConnectionNumber(
_glfw.x11.display);
64 #if defined(__linux__) 65 if (
_glfw.linjs.inotify > fd)
66 count =
_glfw.linjs.inotify + 1;
72 #if defined(__linux__) 73 if (
_glfw.linjs.inotify > 0)
74 FD_SET(
_glfw.linjs.inotify, &fds);
79 const long seconds = (long) *timeout;
80 const long microseconds = (long) ((*timeout - seconds) * 1e6);
81 struct timeval tv = { seconds, microseconds };
85 const int error = errno;
92 if ((result == -1 && error == EINTR) || *timeout <= 0.0)
95 else if (select(count, &fds,
NULL,
NULL,
NULL) != -1 || errno != EINTR)
108 while (!XCheckTypedWindowEvent(
_glfw.x11.display,
124 int result = WithdrawnState;
133 (
unsigned char**) &
state) >= 2)
148 if (event->xany.window !=
_glfw.x11.helperWindowHandle)
151 return event->type == SelectionRequest ||
152 event->type == SelectionNotify ||
153 event->type == SelectionClear;
161 return event->type == PropertyNotify &&
162 event->xproperty.state == PropertyNewValue &&
163 event->xproperty.
window == window->x11.handle &&
164 event->xproperty.atom ==
_glfw.x11.NET_FRAME_EXTENTS;
171 XEvent* notification = (XEvent*) pointer;
172 return event->type == PropertyNotify &&
173 event->xproperty.state == PropertyNewValue &&
174 event->xproperty.window == notification->xselection.requestor &&
175 event->xproperty.atom == notification->xselection.property;
184 if (state & ShiftMask)
186 if (state & ControlMask)
188 if (state & Mod1Mask)
190 if (state & Mod4Mask)
192 if (state & LockMask)
194 if (state & Mod2Mask)
205 if (scancode < 0 || scancode > 255)
208 return _glfw.x11.keycodes[scancode];
214 long a,
long b,
long c,
long d,
long e)
217 memset(&event, 0,
sizeof(event));
219 event.type = ClientMessage;
220 event.xclient.window = window->x11.handle;
221 event.xclient.format = 32;
222 event.xclient.message_type =
type;
223 event.xclient.data.l[0] =
a;
224 event.xclient.data.l[1] =
b;
225 event.xclient.data.l[2] =
c;
226 event.xclient.data.l[3] =
d;
227 event.xclient.data.l[4] =
e;
231 SubstructureNotifyMask | SubstructureRedirectMask,
239 XSizeHints* hints = XAllocSizeHints();
248 hints->flags |= PMinSize;
249 hints->min_width = window->
minwidth;
256 hints->flags |= PMaxSize;
257 hints->max_width = window->
maxwidth;
264 hints->flags |= PAspect;
265 hints->min_aspect.x = hints->max_aspect.x = window->
numer;
266 hints->min_aspect.y = hints->max_aspect.y = window->
denom;
271 hints->flags |= (PMinSize | PMaxSize);
272 hints->min_width = hints->max_width =
width;
273 hints->min_height = hints->max_height =
height;
277 hints->flags |= PWinGravity;
278 hints->win_gravity = StaticGravity;
280 XSetWMNormalHints(
_glfw.x11.display, window->x11.handle, hints);
291 _glfw.x11.NET_WM_FULLSCREEN_MONITORS)
294 _glfw.x11.NET_WM_FULLSCREEN_MONITORS,
302 if (
_glfw.x11.NET_WM_STATE &&
_glfw.x11.NET_WM_STATE_FULLSCREEN)
305 _glfw.x11.NET_WM_STATE,
307 _glfw.x11.NET_WM_STATE_FULLSCREEN,
320 XSetWindowAttributes attributes;
321 attributes.override_redirect = True;
322 XChangeWindowAttributes(
_glfw.x11.display,
327 window->x11.overrideRedirect =
GLFW_TRUE;
331 if (!window->x11.transparent)
333 const unsigned long value = 1;
335 XChangeProperty(
_glfw.x11.display, window->x11.handle,
336 _glfw.x11.NET_WM_BYPASS_COMPOSITOR, XA_CARDINAL, 32,
337 PropModeReplace, (
unsigned char*) &value, 1);
343 _glfw.x11.NET_WM_FULLSCREEN_MONITORS)
345 XDeleteProperty(
_glfw.x11.display, window->x11.handle,
346 _glfw.x11.NET_WM_FULLSCREEN_MONITORS);
349 if (
_glfw.x11.NET_WM_STATE &&
_glfw.x11.NET_WM_STATE_FULLSCREEN)
352 _glfw.x11.NET_WM_STATE,
354 _glfw.x11.NET_WM_STATE_FULLSCREEN,
359 XSetWindowAttributes attributes;
360 attributes.override_redirect = False;
361 XChangeWindowAttributes(
_glfw.x11.display,
370 if (!window->x11.transparent)
372 XDeleteProperty(
_glfw.x11.display, window->x11.handle,
373 _glfw.x11.NET_WM_BYPASS_COMPOSITOR);
383 const char* prefix =
"file://";
389 while ((line = strtok(text,
"\r\n")))
396 if (strncmp(line, prefix, strlen(prefix)) == 0)
398 line += strlen(prefix);
406 char*
path = calloc(strlen(line) + 1, 1);
407 paths = realloc(paths, *count *
sizeof(
char*));
408 paths[*count - 1] =
path;
412 if (line[0] ==
'%' && line[1] && line[2])
414 const char digits[3] = { line[1], line[2],
'\0' };
415 *path = strtol(digits,
NULL, 16);
437 s[count++] = (char) ch;
440 s[count++] = (ch >> 6) | 0xc0;
441 s[count++] = (ch & 0x3f) | 0x80;
443 else if (ch < 0x10000)
445 s[count++] = (ch >> 12) | 0xe0;
446 s[count++] = ((ch >> 6) & 0x3f) | 0x80;
447 s[count++] = (ch & 0x3f) | 0x80;
449 else if (ch < 0x110000)
451 s[count++] = (ch >> 18) | 0xf0;
452 s[count++] = ((ch >> 12) & 0x3f) | 0x80;
453 s[count++] = ((ch >> 6) & 0x3f) | 0x80;
454 s[count++] = (ch & 0x3f) | 0x80;
463 #if defined(X_HAVE_UTF8_STRING) 464 static unsigned int decodeUTF8(
const char**
s)
466 unsigned int ch = 0,
count = 0;
467 static const unsigned int offsets[] =
469 0x00000000u, 0x00003080u, 0x000e2080u,
470 0x03c82080u, 0xfa082080u, 0x82082080u
475 ch = (ch << 6) + (
unsigned char) **
s;
478 }
while ((**s & 0xc0) == 0x80);
481 return ch - offsets[
count - 1];
492 for (sp = source; *sp; sp++)
493 size += (*sp & 0x80) ? 2 : 1;
495 char*
target = calloc(size, 1);
498 for (sp = source; *sp; sp++)
521 XDefineCursor(
_glfw.x11.display, window->x11.handle,
522 window->
cursor->x11.handle);
525 XUndefineCursor(
_glfw.x11.display, window->x11.handle);
529 XDefineCursor(
_glfw.x11.display, window->x11.handle,
530 _glfw.x11.hiddenCursorHandle);
541 unsigned char mask[XIMaskLen(XI_RawMotion)] = { 0 };
543 em.deviceid = XIAllMasterDevices;
544 em.mask_len =
sizeof(
mask);
546 XISetMask(mask, XI_RawMotion);
553 &
_glfw.x11.restoreCursorPosX,
554 &
_glfw.x11.restoreCursorPosY);
557 XGrabPointer(
_glfw.x11.display, window->x11.handle, True,
558 ButtonPressMask | ButtonReleaseMask | PointerMotionMask,
559 GrabModeAsync, GrabModeAsync,
561 _glfw.x11.hiddenCursorHandle,
572 unsigned char mask[] = { 0 };
574 em.deviceid = XIAllMasterDevices;
575 em.mask_len =
sizeof(
mask);
582 XUngrabPointer(
_glfw.x11.display, CurrentTime);
584 _glfw.x11.restoreCursorPosX,
585 _glfw.x11.restoreCursorPosY);
593 Visual* visual,
int depth)
600 width *=
_glfw.x11.contentScaleX;
601 height *=
_glfw.x11.contentScaleY;
605 window->x11.colormap = XCreateColormap(
_glfw.x11.display,
614 XSetWindowAttributes wa;
615 const unsigned long wamask = CWBorderPixel | CWColormap | CWEventMask;
617 wa.colormap = window->x11.colormap;
619 wa.event_mask = StructureNotifyMask | KeyPressMask | KeyReleaseMask |
620 PointerMotionMask | ButtonPressMask | ButtonReleaseMask |
621 ExposureMask | FocusChangeMask | VisibilityChangeMask |
622 EnterWindowMask | LeaveWindowMask | PropertyChangeMask;
626 window->x11.handle = XCreateWindow(
_glfw.x11.display,
639 if (!window->x11.handle)
642 "X11: Failed to create window");
646 XSaveContext(
_glfw.x11.display,
662 if (
_glfw.x11.NET_WM_STATE_ABOVE)
663 states[count++] =
_glfw.x11.NET_WM_STATE_ABOVE;
668 if (
_glfw.x11.NET_WM_STATE_MAXIMIZED_VERT &&
669 _glfw.x11.NET_WM_STATE_MAXIMIZED_HORZ)
671 states[count++] =
_glfw.x11.NET_WM_STATE_MAXIMIZED_VERT;
672 states[count++] =
_glfw.x11.NET_WM_STATE_MAXIMIZED_HORZ;
679 XChangeProperty(
_glfw.x11.display, window->x11.handle,
680 _glfw.x11.NET_WM_STATE, XA_ATOM, 32,
681 PropModeReplace, (
unsigned char*) &states, count);
689 _glfw.x11.WM_DELETE_WINDOW,
690 _glfw.x11.NET_WM_PING
693 XSetWMProtocols(
_glfw.x11.display, window->x11.handle,
694 protocols,
sizeof(protocols) /
sizeof(Atom));
699 const long pid = getpid();
701 XChangeProperty(
_glfw.x11.display, window->x11.handle,
702 _glfw.x11.NET_WM_PID, XA_CARDINAL, 32,
704 (
unsigned char*) &pid, 1);
707 if (
_glfw.x11.NET_WM_WINDOW_TYPE &&
_glfw.x11.NET_WM_WINDOW_TYPE_NORMAL)
709 Atom
type =
_glfw.x11.NET_WM_WINDOW_TYPE_NORMAL;
710 XChangeProperty(
_glfw.x11.display, window->x11.handle,
711 _glfw.x11.NET_WM_WINDOW_TYPE, XA_ATOM, 32,
712 PropModeReplace, (
unsigned char*) &type, 1);
717 XWMHints* hints = XAllocWMHints();
721 "X11: Failed to allocate WM hints");
725 hints->flags = StateHint;
726 hints->initial_state = NormalState;
728 XSetWMHints(
_glfw.x11.display, window->x11.handle, hints);
736 XClassHint* hint = XAllocClassHint();
746 const char* resourceName = getenv(
"RESOURCE_NAME");
747 if (resourceName && strlen(resourceName))
748 hint->res_name = (
char*) resourceName;
749 else if (strlen(wndconfig->
title))
750 hint->res_name = (
char*) wndconfig->
title;
752 hint->res_name = (
char*)
"glfw-application";
754 if (strlen(wndconfig->
title))
755 hint->res_class = (
char*) wndconfig->
title;
757 hint->res_class = (
char*)
"GLFW-Application";
760 XSetClassHint(
_glfw.x11.display, window->x11.handle, hint);
767 XChangeProperty(
_glfw.x11.display, window->x11.handle,
768 _glfw.x11.XdndAware, XA_ATOM, 32,
769 PropModeReplace, (
unsigned char*) &version, 1);
776 window->x11.ic = XCreateIC(
_glfw.x11.im,
778 XIMPreeditNothing | XIMStatusNothing,
797 char* selectionString =
NULL;
798 const Atom formats[] = {
_glfw.x11.UTF8_STRING, XA_STRING };
799 const int formatCount =
sizeof(formats) /
sizeof(formats[0]);
801 if (request->selection ==
_glfw.x11.PRIMARY)
802 selectionString =
_glfw.x11.primarySelectionString;
804 selectionString =
_glfw.x11.clipboardString;
806 if (request->property ==
None)
813 if (request->target ==
_glfw.x11.TARGETS)
817 const Atom targets[] = {
_glfw.x11.TARGETS,
819 _glfw.x11.UTF8_STRING,
822 XChangeProperty(
_glfw.x11.display,
828 (
unsigned char*) targets,
829 sizeof(targets) /
sizeof(targets[0]));
831 return request->property;
834 if (request->target ==
_glfw.x11.MULTIPLE)
844 (
unsigned char**) &targets);
846 for (i = 0; i <
count; i += 2)
850 for (j = 0; j < formatCount; j++)
852 if (targets[i] == formats[j])
858 XChangeProperty(
_glfw.x11.display,
864 (
unsigned char *) selectionString,
865 strlen(selectionString));
868 targets[i + 1] =
None;
871 XChangeProperty(
_glfw.x11.display,
877 (
unsigned char*) targets,
882 return request->property;
885 if (request->target ==
_glfw.x11.SAVE_TARGETS)
890 XChangeProperty(
_glfw.x11.display,
899 return request->property;
904 for (i = 0; i < formatCount; i++)
906 if (request->target == formats[i])
910 XChangeProperty(
_glfw.x11.display,
916 (
unsigned char *) selectionString,
917 strlen(selectionString));
919 return request->property;
930 if (event->xselectionclear.selection ==
_glfw.x11.PRIMARY)
932 free(
_glfw.x11.primarySelectionString);
937 free(
_glfw.x11.clipboardString);
944 const XSelectionRequestEvent* request = &
event->xselectionrequest;
947 memset(&reply, 0,
sizeof(reply));
950 reply.xselection.type = SelectionNotify;
951 reply.xselection.display = request->display;
952 reply.xselection.requestor = request->requestor;
953 reply.xselection.selection = request->selection;
954 reply.xselection.target = request->target;
955 reply.xselection.time = request->time;
957 XSendEvent(
_glfw.x11.display, request->requestor, False, 0, &reply);
963 char** selectionString =
NULL;
964 const Atom targets[] = {
_glfw.x11.UTF8_STRING, XA_STRING };
965 const size_t targetCount =
sizeof(targets) /
sizeof(targets[0]);
967 if (selection ==
_glfw.x11.PRIMARY)
968 selectionString = &
_glfw.x11.primarySelectionString;
970 selectionString = &
_glfw.x11.clipboardString;
972 if (XGetSelectionOwner(
_glfw.x11.display, selection) ==
973 _glfw.x11.helperWindowHandle)
977 return *selectionString;
980 free(*selectionString);
981 *selectionString =
NULL;
983 for (i = 0; i < targetCount; i++)
988 unsigned long itemCount, bytesAfter;
989 XEvent notification, dummy;
991 XConvertSelection(
_glfw.x11.display,
994 _glfw.x11.GLFW_SELECTION,
995 _glfw.x11.helperWindowHandle,
998 while (!XCheckTypedWindowEvent(
_glfw.x11.display,
999 _glfw.x11.helperWindowHandle,
1006 if (notification.xselection.property ==
None)
1009 XCheckIfEvent(
_glfw.x11.display,
1012 (XPointer) ¬ification);
1014 XGetWindowProperty(
_glfw.x11.display,
1015 notification.xselection.requestor,
1016 notification.xselection.property,
1025 (
unsigned char**) &data);
1027 if (actualType ==
_glfw.x11.INCR)
1030 char*
string =
NULL;
1034 while (!XCheckIfEvent(
_glfw.x11.display,
1037 (XPointer) ¬ification))
1043 XGetWindowProperty(
_glfw.x11.display,
1044 notification.xselection.requestor,
1045 notification.xselection.property,
1054 (
unsigned char**) &data);
1059 string = realloc(
string, size);
1060 string[size - itemCount - 1] =
'\0';
1061 strcat(
string, data);
1066 if (targets[i] == XA_STRING)
1072 *selectionString =
string;
1078 else if (actualType == targets[i])
1080 if (targets[i] == XA_STRING)
1088 if (*selectionString)
1092 if (!*selectionString)
1095 "X11: Failed to convert selection to string");
1098 return *selectionString;
1105 if (
_glfw.x11.saver.count == 0)
1108 XGetScreenSaver(
_glfw.x11.display,
1109 &
_glfw.x11.saver.timeout,
1110 &
_glfw.x11.saver.interval,
1111 &
_glfw.x11.saver.blanking,
1112 &
_glfw.x11.saver.exposure);
1115 XSetScreenSaver(
_glfw.x11.display, 0, 0, DontPreferBlanking,
1120 _glfw.x11.saver.count++;
1124 if (window->x11.overrideRedirect)
1133 XMoveResizeWindow(
_glfw.x11.display, window->x11.handle,
1150 _glfw.x11.saver.count--;
1152 if (
_glfw.x11.saver.count == 0)
1155 XSetScreenSaver(
_glfw.x11.display,
1156 _glfw.x11.saver.timeout,
1157 _glfw.x11.saver.interval,
1158 _glfw.x11.saver.blanking,
1159 _glfw.x11.saver.exposure);
1169 Bool filtered = False;
1172 if (event->type == KeyPress || event->type == KeyRelease)
1173 keycode =
event->xkey.keycode;
1176 filtered = XFilterEvent(event,
None);
1180 if (event->type ==
_glfw.x11.randr.eventBase + RRNotify)
1188 if (event->type == GenericEvent)
1195 event->xcookie.extension ==
_glfw.x11.xi.majorOpcode &&
1196 XGetEventData(
_glfw.x11.display, &event->xcookie) &&
1197 event->xcookie.evtype == XI_RawMotion)
1199 XIRawEvent* re =
event->xcookie.data;
1200 if (re->valuators.mask_len)
1202 const double*
values = re->raw_values;
1206 if (XIMaskIsSet(re->valuators.mask, 0))
1212 if (XIMaskIsSet(re->valuators.mask, 1))
1219 XFreeEventData(
_glfw.x11.display, &event->xcookie);
1225 if (event->type == SelectionClear)
1230 else if (event->type == SelectionRequest)
1236 if (XFindContext(
_glfw.x11.display,
1239 (XPointer*) &window) != 0)
1245 switch (event->type)
1259 if (window->x11.lastKeyTime < event->xkey.time)
1264 window->x11.lastKeyTime =
event->xkey.time;
1271 #if defined(X_HAVE_UTF8_STRING) 1275 count = Xutf8LookupString(window->x11.ic,
1277 buffer,
sizeof(buffer) - 1,
1280 if (status == XBufferOverflow)
1282 chars = calloc(count + 1, 1);
1283 count = Xutf8LookupString(window->x11.ic,
1289 if (status == XLookupChars || status == XLookupBoth)
1292 chars[
count] =
'\0';
1293 while (c - chars < count)
1300 count = XwcLookupString(window->x11.ic,
1303 sizeof(buffer) /
sizeof(
wchar_t),
1307 if (status == XBufferOverflow)
1309 chars = calloc(count,
sizeof(
wchar_t));
1310 count = XwcLookupString(window->x11.ic,
1316 if (status == XLookupChars || status == XLookupBoth)
1319 for (i = 0; i <
count; i++)
1324 if (chars != buffer)
1331 XLookupString(&event->xkey,
NULL, 0, &keysym,
NULL);
1336 if (character != -1)
1348 if (!
_glfw.x11.xkb.detectable)
1354 if (XEventsQueued(
_glfw.x11.display, QueuedAfterReading))
1357 XPeekEvent(
_glfw.x11.display, &next);
1359 if (next.type == KeyPress &&
1360 next.xkey.window == event->xkey.window &&
1361 next.xkey.keycode == keycode)
1370 if ((next.xkey.time - event->xkey.time) < 20)
1388 if (event->xbutton.button == Button1)
1390 else if (event->xbutton.button == Button2)
1392 else if (event->xbutton.button == Button3)
1396 else if (event->xbutton.button == Button4)
1398 else if (event->xbutton.button == Button5)
1400 else if (event->xbutton.button ==
Button6)
1402 else if (event->xbutton.button ==
Button7)
1410 event->xbutton.button - Button1 - 4,
1422 if (event->xbutton.button == Button1)
1429 else if (event->xbutton.button == Button2)
1436 else if (event->xbutton.button == Button3)
1443 else if (event->xbutton.button >
Button7)
1448 event->xbutton.button - Button1 - 4,
1459 const int x =
event->xcrossing.x;
1460 const int y =
event->xcrossing.y;
1470 window->x11.lastCursorPosX =
x;
1471 window->x11.lastCursorPosY =
y;
1483 const int x =
event->xmotion.x;
1484 const int y =
event->xmotion.y;
1486 if (x != window->x11.warpCursorPosX ||
1487 y != window->x11.warpCursorPosY)
1493 if (
_glfw.x11.disabledCursorWindow != window)
1498 const int dx = x - window->x11.lastCursorPosX;
1499 const int dy = y - window->x11.lastCursorPosY;
1509 window->x11.lastCursorPosX =
x;
1510 window->x11.lastCursorPosY =
y;
1514 case ConfigureNotify:
1516 if (event->xconfigure.width != window->x11.width ||
1517 event->xconfigure.height != window->x11.height)
1520 event->xconfigure.width,
1521 event->xconfigure.height);
1524 event->xconfigure.width,
1525 event->xconfigure.height);
1527 window->x11.width =
event->xconfigure.width;
1528 window->x11.height =
event->xconfigure.height;
1531 if (event->xconfigure.x != window->x11.xpos ||
1532 event->xconfigure.y != window->x11.ypos)
1534 if (window->x11.overrideRedirect || event->xany.send_event)
1537 event->xconfigure.x,
1538 event->xconfigure.y);
1540 window->x11.xpos =
event->xconfigure.x;
1541 window->x11.ypos =
event->xconfigure.y;
1555 if (event->xclient.message_type ==
None)
1558 if (event->xclient.message_type ==
_glfw.x11.WM_PROTOCOLS)
1560 const Atom protocol =
event->xclient.data.l[0];
1561 if (protocol ==
None)
1564 if (protocol ==
_glfw.x11.WM_DELETE_WINDOW)
1571 else if (protocol ==
_glfw.x11.NET_WM_PING)
1576 XEvent reply = *
event;
1577 reply.xclient.window =
_glfw.x11.root;
1579 XSendEvent(
_glfw.x11.display,
_glfw.x11.root,
1581 SubstructureNotifyMask | SubstructureRedirectMask,
1585 else if (event->xclient.message_type ==
_glfw.x11.XdndEnter)
1589 Atom* formats =
NULL;
1590 const GLFWbool list =
event->xclient.data.l[1] & 1;
1592 _glfw.x11.xdnd.source =
event->xclient.data.l[0];
1593 _glfw.x11.xdnd.version =
event->xclient.data.l[1] >> 24;
1602 _glfw.x11.XdndTypeList,
1604 (
unsigned char**) &formats);
1609 formats = (Atom*) event->xclient.data.l + 2;
1612 for (i = 0; i <
count; i++)
1614 if (formats[i] ==
_glfw.x11.text_uri_list)
1616 _glfw.x11.xdnd.format =
_glfw.x11.text_uri_list;
1621 if (list && formats)
1624 else if (event->xclient.message_type ==
_glfw.x11.XdndDrop)
1627 Time time = CurrentTime;
1632 if (
_glfw.x11.xdnd.format)
1634 if (
_glfw.x11.xdnd.version >= 1)
1635 time =
event->xclient.data.l[2];
1638 XConvertSelection(
_glfw.x11.display,
1639 _glfw.x11.XdndSelection,
1640 _glfw.x11.xdnd.format,
1641 _glfw.x11.XdndSelection,
1645 else if (
_glfw.x11.xdnd.version >= 2)
1648 memset(&reply, 0,
sizeof(reply));
1650 reply.type = ClientMessage;
1651 reply.xclient.window =
_glfw.x11.xdnd.source;
1652 reply.xclient.message_type =
_glfw.x11.XdndFinished;
1653 reply.xclient.format = 32;
1654 reply.xclient.data.l[0] = window->x11.handle;
1655 reply.xclient.data.l[1] = 0;
1656 reply.xclient.data.l[2] =
None;
1658 XSendEvent(
_glfw.x11.display,
_glfw.x11.xdnd.source,
1659 False, NoEventMask, &reply);
1660 XFlush(
_glfw.x11.display);
1663 else if (event->xclient.message_type ==
_glfw.x11.XdndPosition)
1666 const int xabs = (
event->xclient.data.l[2] >> 16) & 0xffff;
1667 const int yabs = (
event->xclient.data.l[2]) & 0xffff;
1674 XTranslateCoordinates(
_glfw.x11.display,
1684 memset(&reply, 0,
sizeof(reply));
1686 reply.type = ClientMessage;
1687 reply.xclient.window =
_glfw.x11.xdnd.source;
1688 reply.xclient.message_type =
_glfw.x11.XdndStatus;
1689 reply.xclient.format = 32;
1690 reply.xclient.data.l[0] = window->x11.handle;
1691 reply.xclient.data.l[2] = 0;
1692 reply.xclient.data.l[3] = 0;
1694 if (
_glfw.x11.xdnd.format)
1697 reply.xclient.data.l[1] = 1;
1698 if (
_glfw.x11.xdnd.version >= 2)
1699 reply.xclient.data.l[4] =
_glfw.x11.XdndActionCopy;
1702 XSendEvent(
_glfw.x11.display,
_glfw.x11.xdnd.source,
1703 False, NoEventMask, &reply);
1704 XFlush(
_glfw.x11.display);
1710 case SelectionNotify:
1712 if (event->xselection.property ==
_glfw.x11.XdndSelection)
1716 const unsigned long result =
1718 event->xselection.property,
1719 event->xselection.target,
1720 (
unsigned char**) &data);
1729 for (i = 0; i <
count; i++)
1737 if (
_glfw.x11.xdnd.version >= 2)
1740 memset(&reply, 0,
sizeof(reply));
1742 reply.type = ClientMessage;
1743 reply.xclient.window =
_glfw.x11.xdnd.source;
1744 reply.xclient.message_type =
_glfw.x11.XdndFinished;
1745 reply.xclient.format = 32;
1746 reply.xclient.data.l[0] = window->x11.handle;
1747 reply.xclient.data.l[1] =
result;
1748 reply.xclient.data.l[2] =
_glfw.x11.XdndActionCopy;
1750 XSendEvent(
_glfw.x11.display,
_glfw.x11.xdnd.source,
1751 False, NoEventMask, &reply);
1752 XFlush(
_glfw.x11.display);
1764 if (event->xfocus.mode == NotifyGrab ||
1765 event->xfocus.mode == NotifyUngrab)
1773 XSetICFocus(window->x11.ic);
1784 if (event->xfocus.mode == NotifyGrab ||
1785 event->xfocus.mode == NotifyUngrab)
1793 XUnsetICFocus(window->x11.ic);
1808 case PropertyNotify:
1810 if (event->xproperty.state != PropertyNewValue)
1813 if (event->xproperty.atom ==
_glfw.x11.WM_STATE)
1816 if (state != IconicState && state != NormalState)
1819 const GLFWbool iconified = (state == IconicState);
1820 if (window->x11.iconified != iconified)
1830 window->x11.iconified = iconified;
1834 else if (event->xproperty.atom ==
_glfw.x11.NET_WM_STATE)
1837 if (window->x11.maximized != maximized)
1863 unsigned char**
value)
1867 unsigned long itemCount, bytesAfter;
1869 XGetWindowProperty(
_glfw.x11.display,
1891 return pf && pf->direct.alphaMask;
1898 XConvertSelection(
_glfw.x11.display,
1899 _glfw.x11.CLIPBOARD_MANAGER,
1900 _glfw.x11.SAVE_TARGETS,
1902 _glfw.x11.helperWindowHandle,
1913 case SelectionRequest:
1917 case SelectionClear:
1921 case SelectionNotify:
1923 if (event.xselection.target ==
_glfw.x11.SAVE_TARGETS)
1968 if (!_glfwChooseVisualEGL(wndconfig, ctxconfig, fbconfig, &visual, &depth))
1981 visual = DefaultVisual(
_glfw.x11.display,
_glfw.x11.screen);
1982 depth = DefaultDepth(
_glfw.x11.display,
_glfw.x11.screen);
2014 XFlush(
_glfw.x11.display);
2020 if (
_glfw.x11.disabledCursorWindow == window)
2028 XDestroyIC(window->x11.ic);
2029 window->x11.ic =
NULL;
2035 if (window->x11.handle)
2038 XUnmapWindow(
_glfw.x11.display, window->x11.handle);
2039 XDestroyWindow(
_glfw.x11.display, window->x11.handle);
2040 window->x11.handle = (Window) 0;
2043 if (window->x11.colormap)
2045 XFreeColormap(
_glfw.x11.display, window->x11.colormap);
2046 window->x11.colormap = (Colormap) 0;
2049 XFlush(
_glfw.x11.display);
2054 #if defined(X_HAVE_UTF8_STRING) 2055 Xutf8SetWMProperties(
_glfw.x11.display,
2063 XmbSetWMProperties(
_glfw.x11.display,
2070 XChangeProperty(
_glfw.x11.display, window->x11.handle,
2071 _glfw.x11.NET_WM_NAME,
_glfw.x11.UTF8_STRING, 8,
2073 (
unsigned char*) title, strlen(title));
2075 XChangeProperty(
_glfw.x11.display, window->x11.handle,
2076 _glfw.x11.NET_WM_ICON_NAME,
_glfw.x11.UTF8_STRING, 8,
2078 (
unsigned char*) title, strlen(title));
2080 XFlush(
_glfw.x11.display);
2088 int i,
j, longCount = 0;
2090 for (i = 0; i <
count; i++)
2091 longCount += 2 + images[i].
width * images[i].
height;
2093 long* icon = calloc(longCount,
sizeof(
long));
2096 for (i = 0; i <
count; i++)
2098 *target++ = images[
i].
width;
2103 *target++ = (images[
i].
pixels[j * 4 + 0] << 16) |
2104 (images[i].
pixels[j * 4 + 1] << 8) |
2105 (images[
i].
pixels[j * 4 + 2] << 0) |
2106 (images[i].
pixels[j * 4 + 3] << 24);
2110 XChangeProperty(
_glfw.x11.display, window->x11.handle,
2111 _glfw.x11.NET_WM_ICON,
2114 (
unsigned char*) icon,
2121 XDeleteProperty(
_glfw.x11.display, window->x11.handle,
2122 _glfw.x11.NET_WM_ICON);
2125 XFlush(
_glfw.x11.display);
2133 XTranslateCoordinates(
_glfw.x11.display, window->x11.handle,
_glfw.x11.root,
2134 0, 0, &x, &y, &dummy);
2149 XSizeHints* hints = XAllocSizeHints();
2151 if (XGetWMNormalHints(
_glfw.x11.display, window->x11.handle, hints, &supplied))
2153 hints->flags |= PPosition;
2154 hints->x = hints->y = 0;
2156 XSetWMNormalHints(
_glfw.x11.display, window->x11.handle, hints);
2162 XMoveWindow(
_glfw.x11.display, window->x11.handle, xpos, ypos);
2163 XFlush(
_glfw.x11.display);
2169 XGetWindowAttributes(
_glfw.x11.display, window->x11.handle, &attribs);
2172 *width = attribs.width;
2174 *height = attribs.height;
2189 XResizeWindow(
_glfw.x11.display, window->x11.handle, width, height);
2192 XFlush(
_glfw.x11.display);
2196 int minwidth,
int minheight,
2197 int maxwidth,
int maxheight)
2202 XFlush(
_glfw.x11.display);
2210 XFlush(
_glfw.x11.display);
2222 long* extents =
NULL;
2227 if (
_glfw.x11.NET_FRAME_EXTENTS ==
None)
2231 _glfw.x11.NET_REQUEST_FRAME_EXTENTS)
2246 while (!XCheckIfEvent(
_glfw.x11.display,
2254 "X11: The window manager has a broken _NET_REQUEST_FRAME_EXTENTS implementation; please report this issue");
2261 _glfw.x11.NET_FRAME_EXTENTS,
2263 (
unsigned char**) &extents) == 4)
2270 *right = extents[1];
2272 *bottom = extents[3];
2280 float* xscale,
float* yscale)
2283 *xscale =
_glfw.x11.contentScaleX;
2285 *yscale =
_glfw.x11.contentScaleY;
2290 if (window->x11.overrideRedirect)
2295 "X11: Iconification of full screen windows requires a WM that supports EWMH full screen");
2299 XIconifyWindow(
_glfw.x11.display, window->x11.handle,
_glfw.x11.screen);
2300 XFlush(
_glfw.x11.display);
2305 if (window->x11.overrideRedirect)
2310 "X11: Iconification of full screen windows requires a WM that supports EWMH full screen");
2316 XMapWindow(
_glfw.x11.display, window->x11.handle);
2321 if (
_glfw.x11.NET_WM_STATE &&
2322 _glfw.x11.NET_WM_STATE_MAXIMIZED_VERT &&
2323 _glfw.x11.NET_WM_STATE_MAXIMIZED_HORZ)
2326 _glfw.x11.NET_WM_STATE,
2328 _glfw.x11.NET_WM_STATE_MAXIMIZED_VERT,
2329 _glfw.x11.NET_WM_STATE_MAXIMIZED_HORZ,
2334 XFlush(
_glfw.x11.display);
2339 if (
_glfw.x11.NET_WM_STATE &&
2340 _glfw.x11.NET_WM_STATE_MAXIMIZED_VERT &&
2341 _glfw.x11.NET_WM_STATE_MAXIMIZED_HORZ)
2344 _glfw.x11.NET_WM_STATE,
2346 _glfw.x11.NET_WM_STATE_MAXIMIZED_VERT,
2347 _glfw.x11.NET_WM_STATE_MAXIMIZED_HORZ,
2349 XFlush(
_glfw.x11.display);
2358 XMapWindow(
_glfw.x11.display, window->x11.handle);
2364 XUnmapWindow(
_glfw.x11.display, window->x11.handle);
2365 XFlush(
_glfw.x11.display);
2371 _glfw.x11.NET_WM_STATE,
2373 _glfw.x11.NET_WM_STATE_DEMANDS_ATTENTION,
2379 if (
_glfw.x11.NET_ACTIVE_WINDOW)
2383 XRaiseWindow(
_glfw.x11.display, window->x11.handle);
2384 XSetInputFocus(
_glfw.x11.display, window->x11.handle,
2385 RevertToParent, CurrentTime);
2388 XFlush(
_glfw.x11.display);
2397 if (window->
monitor == monitor)
2401 if (monitor->
window == window)
2406 XMoveResizeWindow(
_glfw.x11.display, window->x11.handle,
2407 xpos, ypos, width, height);
2422 XMapRaised(
_glfw.x11.display, window->x11.handle);
2428 XMoveResizeWindow(
_glfw.x11.display, window->x11.handle,
2429 xpos, ypos, width, height);
2432 XFlush(
_glfw.x11.display);
2440 XGetInputFocus(
_glfw.x11.display, &focused, &state);
2441 return window->x11.handle == focused;
2451 XWindowAttributes wa;
2452 XGetWindowAttributes(
_glfw.x11.display, window->x11.handle, &wa);
2453 return wa.map_state == IsViewable;
2462 if (!
_glfw.x11.NET_WM_STATE ||
2463 !
_glfw.x11.NET_WM_STATE_MAXIMIZED_VERT ||
2464 !
_glfw.x11.NET_WM_STATE_MAXIMIZED_HORZ)
2469 const unsigned long count =
2471 _glfw.x11.NET_WM_STATE,
2473 (
unsigned char**) &states);
2475 for (i = 0; i <
count; i++)
2477 if (states[i] ==
_glfw.x11.NET_WM_STATE_MAXIMIZED_VERT ||
2478 states[i] ==
_glfw.x11.NET_WM_STATE_MAXIMIZED_HORZ)
2493 Window
w =
_glfw.x11.root;
2497 int rootX, rootY, childX, childY;
2500 if (!XQueryPointer(
_glfw.x11.display, w,
2501 &root, &w, &rootX, &rootY, &childX, &childY, &mask))
2506 if (w == window->x11.handle)
2515 if (!window->x11.transparent)
2518 return XGetSelectionOwner(
_glfw.x11.display,
_glfw.x11.NET_WM_CM_Sx) !=
None;
2532 XDeleteProperty(
_glfw.x11.display,
2534 _glfw.x11.MOTIF_WM_HINTS);
2540 unsigned long flags;
2541 unsigned long functions;
2542 unsigned long decorations;
2548 hints.decorations = 0;
2550 XChangeProperty(
_glfw.x11.display, window->x11.handle,
2551 _glfw.x11.MOTIF_WM_HINTS,
2552 _glfw.x11.MOTIF_WM_HINTS, 32,
2554 (
unsigned char*) &hints,
2555 sizeof(hints) /
sizeof(
long));
2561 if (!
_glfw.x11.NET_WM_STATE || !
_glfw.x11.NET_WM_STATE_ABOVE)
2568 _glfw.x11.NET_WM_STATE,
2570 _glfw.x11.NET_WM_STATE_ABOVE,
2579 _glfw.x11.NET_WM_STATE,
2581 (
unsigned char**) &states);
2587 for (i = 0; i <
count; i++)
2589 if (states[i] ==
_glfw.x11.NET_WM_STATE_ABOVE)
2595 XChangeProperty(
_glfw.x11.display, window->x11.handle,
2596 _glfw.x11.NET_WM_STATE, XA_ATOM, 32,
2598 (
unsigned char*) &
_glfw.x11.NET_WM_STATE_ABOVE,
2604 for (i = 0; i <
count; i++)
2606 if (states[i] ==
_glfw.x11.NET_WM_STATE_ABOVE)
2608 states[
i] = states[count - 1];
2613 XChangeProperty(
_glfw.x11.display, window->x11.handle,
2614 _glfw.x11.NET_WM_STATE, XA_ATOM, 32,
2615 PropModeReplace, (
unsigned char*) &states, count);
2621 XFlush(
_glfw.x11.display);
2626 float opacity = 1.f;
2628 if (XGetSelectionOwner(
_glfw.x11.display,
_glfw.x11.NET_WM_CM_Sx))
2633 _glfw.x11.NET_WM_WINDOW_OPACITY,
2635 (
unsigned char**) &value))
2637 opacity = (float) (*value / (
double) 0xffffffffu);
2649 const CARD32
value = (CARD32) (0xffffffffu * (
double) opacity);
2650 XChangeProperty(
_glfw.x11.display, window->x11.handle,
2651 _glfw.x11.NET_WM_WINDOW_OPACITY, XA_CARDINAL, 32,
2652 PropModeReplace, (
unsigned char*) &value, 1);
2659 #if defined(__linux__) 2662 XPending(
_glfw.x11.display);
2664 while (XQLength(
_glfw.x11.display))
2667 XNextEvent(
_glfw.x11.display, &event);
2671 window =
_glfw.x11.disabledCursorWindow;
2679 if (window->x11.lastCursorPosX != width / 2 ||
2680 window->x11.lastCursorPosY != height / 2)
2686 XFlush(
_glfw.x11.display);
2691 while (!XPending(
_glfw.x11.display))
2699 while (!XPending(
_glfw.x11.display))
2712 memset(&event, 0,
sizeof(event));
2713 event.type = ClientMessage;
2714 event.xclient.window =
_glfw.x11.helperWindowHandle;
2715 event.xclient.format = 32;
2716 event.xclient.message_type =
_glfw.x11.NULL_;
2718 XSendEvent(
_glfw.x11.display,
_glfw.x11.helperWindowHandle, False, 0, &event);
2719 XFlush(
_glfw.x11.display);
2725 int rootX, rootY, childX, childY;
2728 XQueryPointer(
_glfw.x11.display, window->x11.handle,
2730 &rootX, &rootY, &childX, &childY,
2742 window->x11.warpCursorPosX = (int) x;
2743 window->x11.warpCursorPosY = (int) y;
2745 XWarpPointer(
_glfw.x11.display,
None, window->x11.handle,
2746 0,0,0,0, (
int) x, (
int) y);
2747 XFlush(
_glfw.x11.display);
2757 else if (
_glfw.x11.disabledCursorWindow == window)
2762 XFlush(
_glfw.x11.display);
2770 const KeySym keysym = XkbKeycodeToKeysym(
_glfw.x11.display, scancode, 0, 0);
2771 if (keysym == NoSymbol)
2783 return _glfw.x11.keyName;
2796 if (!cursor->x11.handle)
2807 native = XC_left_ptr;
2811 native = XC_crosshair;
2815 native = XC_sb_h_double_arrow;
2817 native = XC_sb_v_double_arrow;
2821 cursor->x11.handle = XCreateFontCursor(
_glfw.x11.display, native);
2822 if (!cursor->x11.handle)
2825 "X11: Failed to create standard cursor");
2834 if (cursor->x11.handle)
2835 XFreeCursor(
_glfw.x11.display, cursor->x11.handle);
2843 XFlush(
_glfw.x11.display);
2849 free(
_glfw.x11.clipboardString);
2852 XSetSelectionOwner(
_glfw.x11.display,
2853 _glfw.x11.CLIPBOARD,
2854 _glfw.x11.helperWindowHandle,
2857 if (XGetSelectionOwner(
_glfw.x11.display,
_glfw.x11.CLIPBOARD) !=
2858 _glfw.x11.helperWindowHandle)
2861 "X11: Failed to become owner of clipboard selection");
2877 if (!
_glfw.
vk.KHR_xlib_surface)
2881 extensions[0] =
"VK_KHR_surface";
2886 extensions[1] =
"VK_KHR_xcb_surface";
2888 extensions[1] =
"VK_KHR_xlib_surface";
2895 VisualID visualID = XVisualIDFromVisual(DefaultVisual(
_glfw.x11.display,
2901 vkGetPhysicalDeviceXcbPresentationSupportKHR =
2904 if (!vkGetPhysicalDeviceXcbPresentationSupportKHR)
2907 "X11: Vulkan instance missing VK_KHR_xcb_surface extension");
2915 "X11: Failed to retrieve XCB connection");
2919 return vkGetPhysicalDeviceXcbPresentationSupportKHR(device,
2927 vkGetPhysicalDeviceXlibPresentationSupportKHR =
2930 if (!vkGetPhysicalDeviceXlibPresentationSupportKHR)
2933 "X11: Vulkan instance missing VK_KHR_xlib_surface extension");
2937 return vkGetPhysicalDeviceXlibPresentationSupportKHR(device,
2959 "X11: Failed to retrieve XCB connection");
2965 if (!vkCreateXcbSurfaceKHR)
2968 "X11: Vulkan instance missing VK_KHR_xcb_surface extension");
2972 memset(&sci, 0,
sizeof(sci));
2975 sci.
window = window->x11.handle;
2977 err = vkCreateXcbSurfaceKHR(instance, &sci, allocator, surface);
2981 "X11: Failed to create Vulkan XCB surface: %s",
2995 if (!vkCreateXlibSurfaceKHR)
2998 "X11: Vulkan instance missing VK_KHR_xlib_surface extension");
3002 memset(&sci, 0,
sizeof(sci));
3005 sci.
window = window->x11.handle;
3007 err = vkCreateXlibSurfaceKHR(instance, &sci, allocator, surface);
3011 "X11: Failed to create Vulkan X11 surface: %s",
3027 return _glfw.x11.display;
3034 return window->x11.handle;
3041 free(
_glfw.x11.primarySelectionString);
3044 XSetSelectionOwner(
_glfw.x11.display,
3046 _glfw.x11.helperWindowHandle,
3049 if (XGetSelectionOwner(
_glfw.x11.display,
_glfw.x11.PRIMARY) !=
3050 _glfw.x11.helperWindowHandle)
3053 "X11: Failed to become owner of primary selection");
void _glfwPlatformSetWindowFloating(_GLFWwindow *window, GLFWbool enabled)
void _glfwPlatformSetWindowSize(_GLFWwindow *window, int width, int height)
static void enableCursor(_GLFWwindow *window)
void _glfwPlatformShowWindow(_GLFWwindow *window)
void _glfwDetectJoystickConnectionLinux(void)
void _glfwPlatformSetWindowAspectRatio(_GLFWwindow *window, int numer, int denom)
GLboolean GLboolean GLboolean b
GLenum GLsizei const void * pointer
static void updateCursorImage(_GLFWwindow *window)
#define GLFW_MOD_CONTROL
If this bit is set one or more Control keys were held down.
void _glfwInputWindowCloseRequest(_GLFWwindow *window)
static void sendEventToWM(_GLFWwindow *window, Atom type, long a, long b, long c, long d, long e)
GLdouble GLdouble GLdouble top
window(int width, int height, const char *title)
static void disableCursor(_GLFWwindow *window)
static char ** parseUriList(char *text, int *count)
GLFWbool _glfwChooseVisualGLX(const _GLFWwndconfig *wndconfig, const _GLFWctxconfig *ctxconfig, const _GLFWfbconfig *fbconfig, Visual **visual, int *depth)
#define _GLFW_REQUIRE_INIT()
int _glfwPlatformWindowVisible(_GLFWwindow *window)
static GLFWwindow * window
GLFWbool _glfwInitOSMesa(void)
int _glfwPlatformCreateCursor(_GLFWcursor *cursor, const GLFWimage *image, int xhot, int yhot)
void _glfwInputWindowIconify(_GLFWwindow *window, GLFWbool iconified)
GLFWAPI void glfwSetX11SelectionString(const char *string)
GLuint64 GLenum void * handle
static void updateNormalHints(_GLFWwindow *window, int width, int height)
void _glfwPlatformSetWindowDecorated(_GLFWwindow *window, GLFWbool enabled)
void _glfwSetVideoModeX11(_GLFWmonitor *monitor, const GLFWvidmode *desired)
GLsizei const GLchar *const * path
_GLFWdestroycontextfun destroy
void _glfwInputFramebufferSize(_GLFWwindow *window, int width, int height)
static void handleSelectionClear(XEvent *event)
static int translateState(int state)
GLsizei const GLuint * paths
int _glfwPlatformCreateWindow(_GLFWwindow *window, const _GLFWwndconfig *wndconfig, const _GLFWctxconfig *ctxconfig, const _GLFWfbconfig *fbconfig)
void _glfwPlatformSetCursor(_GLFWwindow *window, _GLFWcursor *cursor)
void _glfwPlatformSetWindowTitle(_GLFWwindow *window, const char *title)
void _glfwPlatformWaitEventsTimeout(double timeout)
void _glfwInputWindowMaximize(_GLFWwindow *window, GLFWbool maximized)
void _glfwPlatformSetWindowResizable(_GLFWwindow *window, GLFWbool enabled)
GLint GLint GLsizei GLsizei GLsizei depth
int _glfwPlatformWindowFocused(_GLFWwindow *window)
uint64_t _glfwPlatformGetTimerFrequency(void)
GLFWbool _glfwInitGLX(void)
char * _glfw_strdup(const char *source)
const char * _glfwGetVulkanResultString(VkResult result)
struct _GLFWlibrary::@29 vk
void _glfwPlatformGetVideoMode(_GLFWmonitor *monitor, GLFWvidmode *mode)
#define GLFW_CROSSHAIR_CURSOR
The crosshair shape.
GLdouble GLdouble GLdouble w
GLsizei const GLchar *const * string
#define GLFW_API_UNAVAILABLE
GLFW could not find support for the requested API on the system.
#define GLFW_EGL_CONTEXT_API
void _glfwPlatformGetWindowPos(_GLFWwindow *window, int *xpos, int *ypos)
#define GLFW_FORMAT_UNAVAILABLE
The requested format is not supported or available.
const char * _glfwPlatformGetClipboardString(void)
#define GLFW_ARROW_CURSOR
The regular arrow cursor shape.
void _glfwPlatformGetCursorPos(_GLFWwindow *window, double *xpos, double *ypos)
int _glfwPlatformFramebufferTransparent(_GLFWwindow *window)
void _glfwInputWindowDamage(_GLFWwindow *window)
GLenum GLenum GLsizei void * image
int _glfwPlatformWindowHovered(_GLFWwindow *window)
status
Defines return codes that SDK interfaces use. Negative values indicate errors, a zero value indicates...
void _glfwInputWindowPos(_GLFWwindow *window, int xpos, int ypos)
void _glfwGrabErrorHandlerX11(void)
void _glfwPlatformGetRequiredInstanceExtensions(char **extensions)
void _glfwPlatformFocusWindow(_GLFWwindow *window)
void _glfwPlatformHideWindow(_GLFWwindow *window)
GLboolean GLboolean GLboolean GLboolean a
static void processEvent(XEvent *event)
#define GLFW_CURSOR_DISABLED
void _glfwPlatformSetWindowPos(_GLFWwindow *window, int xpos, int ypos)
int _glfwPlatformCreateStandardCursor(_GLFWcursor *cursor, int shape)
void _glfwPlatformRestoreWindow(_GLFWwindow *window)
void _glfwPlatformSetCursorPos(_GLFWwindow *window, double x, double y)
#define GLFW_VRESIZE_CURSOR
The vertical resize arrow shape.
#define _GLFW_REQUIRE_INIT_OR_RETURN(x)
int _glfwPlatformWindowIconified(_GLFWwindow *window)
GLFWbool _glfwCreateContextEGL(_GLFWwindow *window, const _GLFWctxconfig *ctxconfig, const _GLFWfbconfig *fbconfig)
void _glfwPlatformSetCursorMode(_GLFWwindow *window, int mode)
#define GLFW_CURSOR_NORMAL
#define GLFW_PLATFORM_ERROR
A platform-specific error occurred that does not match any of the more specific categories.
#define GLFW_NATIVE_CONTEXT_API
void _glfwInputErrorX11(int error, const char *message)
void _glfwInputWindowFocus(_GLFWwindow *window, GLFWbool focused)
#define _GLFW_XDND_VERSION
#define GLFW_MOD_SUPER
If this bit is set one or more Super keys were held down.
#define GLFW_HAND_CURSOR
The hand shape.
static size_t encodeUTF8(char *s, unsigned int ch)
#define GLFW_MOD_SHIFT
If this bit is set one or more Shift keys were held down.
void _glfwPlatformPostEmptyEvent(void)
void _glfwPlatformIconifyWindow(_GLFWwindow *window)
static Atom writeTargetToProperty(const XSelectionRequestEvent *request)
GLint GLsizei GLsizei height
static GLFWbool waitForVisibilityNotify(_GLFWwindow *window)
static void handleSelectionRequest(XEvent *event)
static void releaseMonitor(_GLFWwindow *window)
GLFWAPI const char * glfwGetX11SelectionString(void)
unsigned __int64 uint64_t
static void centerCursor(_GLFWwindow *window)
void _glfwPlatformGetMonitorPos(_GLFWmonitor *monitor, int *xpos, int *ypos)
GLenum GLenum GLsizei const GLuint GLboolean enabled
VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL vkGetInstanceProcAddr(VkInstance instance, const char *pName)
#define GLFW_OSMESA_CONTEXT_API
static char * convertLatin1toUTF8(const char *source)
static GLFWbool createNativeWindow(_GLFWwindow *window, const _GLFWwndconfig *wndconfig, Visual *visual, int depth)
float _glfwPlatformGetWindowOpacity(_GLFWwindow *window)
void _glfwInputError(int code, const char *format,...)
int _glfwPlatformWindowMaximized(_GLFWwindow *window)
GLint GLint GLsizei GLint GLenum GLenum const void * pixels
void _glfwPollMonitorsX11(void)
long _glfwKeySym2Unicode(unsigned int keysym)
#define GLFW_MOD_ALT
If this bit is set one or more Alt keys were held down.
unsigned long _glfwGetWindowPropertyX11(Window window, Atom property, Atom type, unsigned char **value)
void _glfwInputWindowSize(_GLFWwindow *window, int width, int height)
GLFWbool _glfwCreateContextGLX(_GLFWwindow *window, const _GLFWctxconfig *ctxconfig, const _GLFWfbconfig *fbconfig)
void _glfwPlatformSetClipboardString(const char *string)
#define GLFW_MOD_CAPS_LOCK
If this bit is set the Caps Lock key is enabled.
void _glfwPlatformSetWindowMonitor(_GLFWwindow *window, _GLFWmonitor *monitor, int xpos, int ypos, int width, int height, int refreshRate)
GLuint GLsizei const GLuint const GLintptr * offsets
void _glfwPushSelectionToManagerX11(void)
static GLFWbool waitForEvent(double *timeout)
void _glfwPlatformGetWindowFrameSize(_GLFWwindow *window, int *left, int *top, int *right, int *bottom)
uint64_t _glfwPlatformGetTimerValue(void)
static void acquireMonitor(_GLFWwindow *window)
void _glfwInputWindowMonitor(_GLFWwindow *window, _GLFWmonitor *monitor)
GLsizei const GLfloat * values
void next(auto_any_t cur, type2type< T, C > *)
int _glfwPlatformGetPhysicalDevicePresentationSupport(VkInstance instance, VkPhysicalDevice device, uint32_t queuefamily)
static Bool isSelectionEvent(Display *display, XEvent *event, XPointer pointer)
void _glfwPlatformSetWindowOpacity(_GLFWwindow *window, float opacity)
Cursor _glfwCreateCursorX11(const GLFWimage *image, int xhot, int yhot)
static Bool isFrameExtentsEvent(Display *display, XEvent *event, XPointer pointer)
void _glfwRestoreVideoModeX11(_GLFWmonitor *monitor)
#define GLFW_CURSOR_HIDDEN
GLbitfield GLuint64 timeout
void _glfwPlatformSetWindowSizeLimits(_GLFWwindow *window, int minwidth, int minheight, int maxwidth, int maxheight)
#define GLFW_HRESIZE_CURSOR
The horizontal resize arrow shape.
void _glfwReleaseErrorHandlerX11(void)
#define GLFW_OUT_OF_MEMORY
A memory allocation failed.
GLFWAPI Display * glfwGetX11Display(void)
void _glfwPlatformGetFramebufferSize(_GLFWwindow *window, int *width, int *height)
#define GLFW_IBEAM_CURSOR
The text input I-beam cursor shape.
GLFWbool _glfwCreateContextOSMesa(_GLFWwindow *window, const _GLFWctxconfig *ctxconfig, const _GLFWfbconfig *fbconfig)
static const char * maximized
void _glfwPlatformRequestWindowAttention(_GLFWwindow *window)
void _glfwPlatformPollEvents(void)
void _glfwInputMonitorWindow(_GLFWmonitor *monitor, _GLFWwindow *window)
int _glfwPlatformGetKeyScancode(int key)
GLFWAPI Window glfwGetX11Window(GLFWwindow *handle)
static Bool isSelPropNewValueNotify(Display *display, XEvent *event, XPointer pointer)
void _glfwPlatformMaximizeWindow(_GLFWwindow *window)
#define _NET_WM_STATE_REMOVE
xcb_connection_t * connection
static void updateWindowMode(_GLFWwindow *window)
GLsizei GLsizei GLchar * source
void _glfwPlatformGetWindowSize(_GLFWwindow *window, int *width, int *height)
void _glfwPlatformGetWindowContentScale(_GLFWwindow *window, float *xscale, float *yscale)
void _glfwPlatformDestroyWindow(_GLFWwindow *window)
static int getWindowState(_GLFWwindow *window)
GLFWbool _glfwInitEGL(void)
::std_msgs::Time_< std::allocator< void > > Time
VkResult _glfwPlatformCreateWindowSurface(VkInstance instance, _GLFWwindow *window, const VkAllocationCallbacks *allocator, VkSurfaceKHR *surface)
static int translateKey(int scancode)
void _glfwPlatformWaitEvents(void)
const char * _glfwPlatformGetScancodeName(int scancode)
#define _NET_WM_STATE_ADD
struct _GLFWwndconfig::@24 x11
void _glfwPlatformDestroyCursor(_GLFWcursor *cursor)
struct GLFWwindow GLFWwindow
static const char * getSelectionString(Atom selection)
#define GLFW_MOD_NUM_LOCK
If this bit is set the Num Lock key is enabled.
void _glfwPlatformSetWindowIcon(_GLFWwindow *window, int count, const GLFWimage *images)
GLFWbool _glfwIsVisualTransparentX11(Visual *visual)