32#include <X11/cursorfont.h>
35#include <sys/select.h>
45#define _NET_WM_STATE_REMOVE 0
46#define _NET_WM_STATE_ADD 1
47#define _NET_WM_STATE_TOGGLE 2
54#define MWM_HINTS_DECORATIONS 2
55#define MWM_DECOR_ALL 1
57#define _GLFW_XDND_VERSION 5
64static GLFWbool waitForEvent(
double* timeout)
67 const int fd = ConnectionNumber(
_glfw.x11.display);
71 if (
_glfw.linjs.inotify > fd)
72 count =
_glfw.linjs.inotify + 1;
79 if (
_glfw.linjs.inotify > 0)
80 FD_SET(
_glfw.linjs.inotify, &fds);
85 const long seconds = (long) *timeout;
86 const long microseconds = (long) ((*timeout - seconds) * 1e6);
87 struct timeval tv = { seconds, microseconds };
90 const int result = select(count, &fds,
NULL,
NULL, &tv);
91 const int error = errno;
98 if ((result == -1 && error == EINTR) || *timeout <= 0.0)
101 else if (select(count, &fds,
NULL,
NULL,
NULL) != -1 || errno != EINTR)
112 double timeout = 0.1;
119 if (!waitForEvent(&timeout))
130 int result = WithdrawnState;
139 (
unsigned char**) &state) >= 2)
141 result = state->state;
152static Bool isSelectionEvent(Display* display, XEvent* event, XPointer pointer)
154 if (event->xany.window !=
_glfw.x11.helperWindowHandle)
157 return event->type == SelectionRequest ||
158 event->type == SelectionNotify ||
159 event->type == SelectionClear;
164static Bool isFrameExtentsEvent(Display* display, XEvent* event, XPointer pointer)
167 return event->type == PropertyNotify &&
168 event->xproperty.state == PropertyNewValue &&
169 event->xproperty.window == window->x11.handle &&
170 event->xproperty.atom ==
_glfw.x11.NET_FRAME_EXTENTS;
175static Bool isSelPropNewValueNotify(Display* display, XEvent* event, XPointer pointer)
177 XEvent* notification = (XEvent*) pointer;
178 return event->type == PropertyNotify &&
179 event->xproperty.state == PropertyNewValue &&
180 event->xproperty.window == notification->xselection.requestor &&
181 event->xproperty.atom == notification->xselection.property;
186static int translateState(
int state)
190 if (state & ShiftMask)
192 if (state & ControlMask)
194 if (state & Mod1Mask)
196 if (state & Mod4Mask)
198 if (state & LockMask)
200 if (state & Mod2Mask)
208static int translateKey(
int scancode)
211 if (scancode < 0 || scancode > 255)
214 return _glfw.x11.keycodes[scancode];
219static void sendEventToWM(
_GLFWwindow* window, Atom type,
220 long a,
long b,
long c,
long d,
long e)
222 XEvent
event = { ClientMessage };
223 event.xclient.window = window->x11.handle;
224 event.xclient.format = 32;
225 event.xclient.message_type = type;
226 event.xclient.data.l[0] = a;
227 event.xclient.data.l[1] = b;
228 event.xclient.data.l[2] = c;
229 event.xclient.data.l[3] = d;
230 event.xclient.data.l[4] = e;
234 SubstructureNotifyMask | SubstructureRedirectMask,
240static void updateNormalHints(
_GLFWwindow* window,
int width,
int height)
251 hints->flags |= PMinSize;
252 hints->min_width = window->
minwidth;
259 hints->flags |= PMaxSize;
260 hints->max_width = window->
maxwidth;
267 hints->flags |= PAspect;
268 hints->min_aspect.x = hints->max_aspect.x = window->
numer;
269 hints->min_aspect.y = hints->max_aspect.y = window->
denom;
274 hints->flags |= (PMinSize | PMaxSize);
275 hints->min_width = hints->max_width = width;
276 hints->min_height = hints->max_height = height;
280 hints->flags |= PWinGravity;
281 hints->win_gravity = StaticGravity;
294 _glfw.x11.NET_WM_FULLSCREEN_MONITORS)
296 sendEventToWM(window,
297 _glfw.x11.NET_WM_FULLSCREEN_MONITORS,
305 if (
_glfw.x11.NET_WM_STATE &&
_glfw.x11.NET_WM_STATE_FULLSCREEN)
307 sendEventToWM(window,
308 _glfw.x11.NET_WM_STATE,
310 _glfw.x11.NET_WM_STATE_FULLSCREEN,
323 XSetWindowAttributes attributes;
324 attributes.override_redirect = True;
330 window->x11.overrideRedirect =
GLFW_TRUE;
334 if (!window->x11.transparent)
336 const unsigned long value = 1;
339 _glfw.x11.NET_WM_BYPASS_COMPOSITOR, XA_CARDINAL, 32,
340 PropModeReplace, (
unsigned char*) &value, 1);
346 _glfw.x11.NET_WM_FULLSCREEN_MONITORS)
349 _glfw.x11.NET_WM_FULLSCREEN_MONITORS);
352 if (
_glfw.x11.NET_WM_STATE &&
_glfw.x11.NET_WM_STATE_FULLSCREEN)
354 sendEventToWM(window,
355 _glfw.x11.NET_WM_STATE,
357 _glfw.x11.NET_WM_STATE_FULLSCREEN,
362 XSetWindowAttributes attributes;
363 attributes.override_redirect = False;
373 if (!window->x11.transparent)
376 _glfw.x11.NET_WM_BYPASS_COMPOSITOR);
384static char** parseUriList(
char* text,
int* count)
386 const char* prefix =
"file://";
392 while ((line = strtok(text,
"\r\n")))
399 if (strncmp(line, prefix, strlen(prefix)) == 0)
401 line += strlen(prefix);
409 char* path = calloc(strlen(line) + 1, 1);
410 paths = realloc(paths, *count *
sizeof(
char*));
411 paths[*count - 1] = path;
415 if (line[0] ==
'%' && line[1] && line[2])
417 const char digits[3] = { line[1], line[2],
'\0' };
418 *path = strtol(digits,
NULL, 16);
435static size_t encodeUTF8(
char* s,
unsigned int ch)
440 s[count++] = (char) ch;
443 s[count++] = (ch >> 6) | 0xc0;
444 s[count++] = (ch & 0x3f) | 0x80;
446 else if (ch < 0x10000)
448 s[count++] = (ch >> 12) | 0xe0;
449 s[count++] = ((ch >> 6) & 0x3f) | 0x80;
450 s[count++] = (ch & 0x3f) | 0x80;
452 else if (ch < 0x110000)
454 s[count++] = (ch >> 18) | 0xf0;
455 s[count++] = ((ch >> 12) & 0x3f) | 0x80;
456 s[count++] = ((ch >> 6) & 0x3f) | 0x80;
457 s[count++] = (ch & 0x3f) | 0x80;
466static unsigned int decodeUTF8(
const char** s)
468 unsigned int ch = 0, count = 0;
469 static const unsigned int offsets[] =
471 0x00000000u, 0x00003080u, 0x000e2080u,
472 0x03c82080u, 0xfa082080u, 0x82082080u
477 ch = (ch << 6) + (
unsigned char) **s;
480 }
while ((**s & 0xc0) == 0x80);
483 return ch - offsets[count - 1];
488static char* convertLatin1toUTF8(
const char* source)
493 for (sp = source; *sp; sp++)
494 size += (*sp & 0x80) ? 2 : 1;
496 char* target = calloc(size, 1);
499 for (sp = source; *sp; sp++)
500 tp += encodeUTF8(tp, *sp);
514 window->
cursor->x11.handle);
522 _glfw.x11.hiddenCursorHandle);
528static void enableRawMouseMotion(
_GLFWwindow* window)
531 unsigned char mask[XIMaskLen(XI_RawMotion)] = { 0 };
533 em.deviceid = XIAllMasterDevices;
534 em.mask_len =
sizeof(mask);
536 XISetMask(mask, XI_RawMotion);
543static void disableRawMouseMotion(
_GLFWwindow* window)
546 unsigned char mask[] = { 0 };
548 em.deviceid = XIAllMasterDevices;
549 em.mask_len =
sizeof(mask);
560 enableRawMouseMotion(window);
562 _glfw.x11.disabledCursorWindow = window;
564 &
_glfw.x11.restoreCursorPosX,
565 &
_glfw.x11.restoreCursorPosY);
566 updateCursorImage(window);
569 ButtonPressMask | ButtonReleaseMask | PointerMotionMask,
570 GrabModeAsync, GrabModeAsync,
572 _glfw.x11.hiddenCursorHandle,
581 disableRawMouseMotion(window);
586 _glfw.x11.restoreCursorPosX,
587 _glfw.x11.restoreCursorPosY);
588 updateCursorImage(window);
593static void inputContextDestroyCallback(XIC ic, XPointer clientData, XPointer callData)
596 window->x11.ic =
NULL;
603 Visual* visual,
int depth)
605 int width = wndconfig->
width;
606 int height = wndconfig->
height;
610 width *=
_glfw.x11.contentScaleX;
611 height *=
_glfw.x11.contentScaleY;
622 XSetWindowAttributes wa = { 0 };
623 wa.colormap = window->x11.colormap;
624 wa.event_mask = StructureNotifyMask | KeyPressMask | KeyReleaseMask |
625 PointerMotionMask | ButtonPressMask | ButtonReleaseMask |
626 ExposureMask | FocusChangeMask | VisibilityChangeMask |
627 EnterWindowMask | LeaveWindowMask | PropertyChangeMask;
631 window->x11.parent =
_glfw.x11.root;
640 CWBorderPixel | CWColormap | CWEventMask,
645 if (!window->x11.handle)
648 "X11: Failed to create window");
667 if (
_glfw.x11.NET_WM_STATE_ABOVE)
668 states[count++] =
_glfw.x11.NET_WM_STATE_ABOVE;
673 if (
_glfw.x11.NET_WM_STATE_MAXIMIZED_VERT &&
674 _glfw.x11.NET_WM_STATE_MAXIMIZED_HORZ)
676 states[count++] =
_glfw.x11.NET_WM_STATE_MAXIMIZED_VERT;
677 states[count++] =
_glfw.x11.NET_WM_STATE_MAXIMIZED_HORZ;
685 _glfw.x11.NET_WM_STATE, XA_ATOM, 32,
686 PropModeReplace, (
unsigned char*) states, count);
694 _glfw.x11.WM_DELETE_WINDOW,
695 _glfw.x11.NET_WM_PING
699 protocols,
sizeof(protocols) /
sizeof(Atom));
704 const long pid = getpid();
707 _glfw.x11.NET_WM_PID, XA_CARDINAL, 32,
709 (
unsigned char*) &pid, 1);
712 if (
_glfw.x11.NET_WM_WINDOW_TYPE &&
_glfw.x11.NET_WM_WINDOW_TYPE_NORMAL)
714 Atom type =
_glfw.x11.NET_WM_WINDOW_TYPE_NORMAL;
716 _glfw.x11.NET_WM_WINDOW_TYPE, XA_ATOM, 32,
717 PropModeReplace, (
unsigned char*) &type, 1);
726 "X11: Failed to allocate WM hints");
730 hints->flags = StateHint;
731 hints->initial_state = NormalState;
737 updateNormalHints(window, width, height);
751 const char* resourceName = getenv(
"RESOURCE_NAME");
752 if (resourceName && strlen(resourceName))
753 hint->res_name = (
char*) resourceName;
754 else if (strlen(wndconfig->
title))
755 hint->res_name = (
char*) wndconfig->
title;
757 hint->res_name = (
char*)
"glfw-application";
759 if (strlen(wndconfig->
title))
760 hint->res_class = (
char*) wndconfig->
title;
762 hint->res_class = (
char*)
"GLFW-Application";
773 _glfw.x11.XdndAware, XA_ATOM, 32,
774 PropModeReplace, (
unsigned char*) &version, 1);
789static Atom writeTargetToProperty(
const XSelectionRequestEvent* request)
792 char* selectionString =
NULL;
793 const Atom formats[] = {
_glfw.x11.UTF8_STRING, XA_STRING };
794 const int formatCount =
sizeof(formats) /
sizeof(formats[0]);
796 if (request->selection ==
_glfw.x11.PRIMARY)
797 selectionString =
_glfw.x11.primarySelectionString;
799 selectionString =
_glfw.x11.clipboardString;
801 if (request->property == None)
808 if (request->target ==
_glfw.x11.TARGETS)
812 const Atom targets[] = {
_glfw.x11.TARGETS,
814 _glfw.x11.UTF8_STRING,
823 (
unsigned char*) targets,
824 sizeof(targets) /
sizeof(targets[0]));
826 return request->property;
829 if (request->target ==
_glfw.x11.MULTIPLE)
834 unsigned long i, count;
839 (
unsigned char**) &targets);
841 for (i = 0; i < count; i += 2)
845 for (j = 0; j < formatCount; j++)
847 if (targets[i] == formats[j])
859 (
unsigned char *) selectionString,
860 strlen(selectionString));
863 targets[i + 1] = None;
872 (
unsigned char*) targets,
877 return request->property;
880 if (request->target ==
_glfw.x11.SAVE_TARGETS)
894 return request->property;
899 for (i = 0; i < formatCount; i++)
901 if (request->target == formats[i])
911 (
unsigned char *) selectionString,
912 strlen(selectionString));
914 return request->property;
923static void handleSelectionClear(XEvent* event)
925 if (event->xselectionclear.selection ==
_glfw.x11.PRIMARY)
927 free(
_glfw.x11.primarySelectionString);
932 free(
_glfw.x11.clipboardString);
937static void handleSelectionRequest(XEvent* event)
939 const XSelectionRequestEvent* request = &
event->xselectionrequest;
941 XEvent reply = { SelectionNotify };
942 reply.xselection.property = writeTargetToProperty(request);
943 reply.xselection.display = request->display;
944 reply.xselection.requestor = request->requestor;
945 reply.xselection.selection = request->selection;
946 reply.xselection.target = request->target;
947 reply.xselection.time = request->time;
952static const char* getSelectionString(Atom selection)
954 char** selectionString =
NULL;
955 const Atom targets[] = {
_glfw.x11.UTF8_STRING, XA_STRING };
956 const size_t targetCount =
sizeof(targets) /
sizeof(targets[0]);
958 if (selection ==
_glfw.x11.PRIMARY)
959 selectionString = &
_glfw.x11.primarySelectionString;
961 selectionString = &
_glfw.x11.clipboardString;
964 _glfw.x11.helperWindowHandle)
968 return *selectionString;
971 free(*selectionString);
972 *selectionString =
NULL;
974 for (
size_t i = 0; i < targetCount; i++)
979 unsigned long itemCount, bytesAfter;
980 XEvent notification, dummy;
985 _glfw.x11.GLFW_SELECTION,
986 _glfw.x11.helperWindowHandle,
990 _glfw.x11.helperWindowHandle,
997 if (notification.xselection.property == None)
1002 isSelPropNewValueNotify,
1003 (XPointer) ¬ification);
1006 notification.xselection.requestor,
1007 notification.xselection.property,
1016 (
unsigned char**) &data);
1018 if (actualType ==
_glfw.x11.INCR)
1021 char*
string =
NULL;
1027 isSelPropNewValueNotify,
1028 (XPointer) ¬ification))
1035 notification.xselection.requestor,
1036 notification.xselection.property,
1045 (
unsigned char**) &data);
1050 string = realloc(
string, size);
1051 string[size - itemCount - 1] =
'\0';
1052 strcat(
string, data);
1057 if (targets[i] == XA_STRING)
1059 *selectionString = convertLatin1toUTF8(
string);
1063 *selectionString = string;
1069 else if (actualType == targets[i])
1071 if (targets[i] == XA_STRING)
1072 *selectionString = convertLatin1toUTF8(data);
1079 if (*selectionString)
1083 if (!*selectionString)
1086 "X11: Failed to convert selection to string");
1089 return *selectionString;
1096 if (
_glfw.x11.saver.count == 0)
1100 &
_glfw.x11.saver.timeout,
1101 &
_glfw.x11.saver.interval,
1102 &
_glfw.x11.saver.blanking,
1103 &
_glfw.x11.saver.exposure);
1111 _glfw.x11.saver.count++;
1115 if (window->x11.overrideRedirect)
1141 _glfw.x11.saver.count--;
1143 if (
_glfw.x11.saver.count == 0)
1147 _glfw.x11.saver.timeout,
1148 _glfw.x11.saver.interval,
1149 _glfw.x11.saver.blanking,
1150 _glfw.x11.saver.exposure);
1156static void processEvent(XEvent *event)
1159 Bool filtered = False;
1162 if (event->type == KeyPress || event->type == KeyRelease)
1163 keycode =
event->xkey.keycode;
1169 if (event->type ==
_glfw.x11.randr.eventBase + RRNotify)
1179 if (event->type ==
_glfw.x11.xkb.eventBase + XkbEventCode)
1181 if (((XkbEvent*) event)->any.xkb_type == XkbStateNotify &&
1182 (((XkbEvent*) event)->state.changed & XkbGroupStateMask))
1184 _glfw.x11.xkb.group = ((XkbEvent*) event)->state.group;
1191 if (event->type == GenericEvent)
1199 event->xcookie.extension ==
_glfw.x11.xi.majorOpcode &&
1201 event->xcookie.evtype == XI_RawMotion)
1203 XIRawEvent* re =
event->xcookie.data;
1204 if (re->valuators.mask_len)
1206 const double* values = re->raw_values;
1210 if (XIMaskIsSet(re->valuators.mask, 0))
1216 if (XIMaskIsSet(re->valuators.mask, 1))
1229 if (event->type == SelectionClear)
1231 handleSelectionClear(event);
1234 else if (event->type == SelectionRequest)
1236 handleSelectionRequest(event);
1244 (XPointer*) &window) != 0)
1250 switch (event->type)
1252 case ReparentNotify:
1254 window->x11.parent =
event->xreparent.parent;
1260 const int key = translateKey(keycode);
1261 const int mods = translateState(event->xkey.state);
1273 Time diff =
event->xkey.time - window->x11.keyPressTimes[keycode];
1274 if (diff == event->xkey.time || (diff > 0 && diff < (1 << 31)))
1279 window->x11.keyPressTimes[keycode] =
event->xkey.time;
1287 char* chars = buffer;
1291 buffer,
sizeof(buffer) - 1,
1294 if (status == XBufferOverflow)
1296 chars = calloc(count + 1, 1);
1303 if (status == XLookupChars || status == XLookupBoth)
1305 const char* c = chars;
1306 chars[count] =
'\0';
1307 while (c - chars < count)
1311 if (chars != buffer)
1323 if (character != -1)
1332 const int key = translateKey(keycode);
1333 const int mods = translateState(event->xkey.state);
1335 if (!
_glfw.x11.xkb.detectable)
1346 if (next.type == KeyPress &&
1347 next.xkey.window == event->xkey.window &&
1348 next.xkey.keycode == keycode)
1357 if ((next.xkey.time - event->xkey.time) < 20)
1373 const int mods = translateState(event->xbutton.state);
1375 if (event->xbutton.button == Button1)
1377 else if (event->xbutton.button == Button2)
1379 else if (event->xbutton.button == Button3)
1383 else if (event->xbutton.button == Button4)
1385 else if (event->xbutton.button == Button5)
1387 else if (event->xbutton.button ==
Button6)
1389 else if (event->xbutton.button ==
Button7)
1397 event->xbutton.button - Button1 - 4,
1407 const int mods = translateState(event->xbutton.state);
1409 if (event->xbutton.button == Button1)
1416 else if (event->xbutton.button == Button2)
1423 else if (event->xbutton.button == Button3)
1430 else if (event->xbutton.button >
Button7)
1435 event->xbutton.button - Button1 - 4,
1446 const int x =
event->xcrossing.x;
1447 const int y =
event->xcrossing.y;
1452 updateCursorImage(window);
1457 window->x11.lastCursorPosX = x;
1458 window->x11.lastCursorPosY = y;
1470 const int x =
event->xmotion.x;
1471 const int y =
event->xmotion.y;
1473 if (x != window->x11.warpCursorPosX ||
1474 y != window->x11.warpCursorPosY)
1480 if (
_glfw.x11.disabledCursorWindow != window)
1482 if (window->rawMouseMotion)
1485 const int dx = x - window->x11.lastCursorPosX;
1486 const int dy = y - window->x11.lastCursorPosY;
1489 window->virtualCursorPosX + dx,
1490 window->virtualCursorPosY + dy);
1496 window->x11.lastCursorPosX = x;
1497 window->x11.lastCursorPosY = y;
1501 case ConfigureNotify:
1503 if (event->xconfigure.width != window->x11.width ||
1504 event->xconfigure.height != window->x11.height)
1507 event->xconfigure.width,
1508 event->xconfigure.height);
1511 event->xconfigure.width,
1512 event->xconfigure.height);
1514 window->x11.width =
event->xconfigure.width;
1515 window->x11.height =
event->xconfigure.height;
1518 int xpos =
event->xconfigure.x;
1519 int ypos =
event->xconfigure.y;
1524 if (!event->xany.send_event && window->x11.parent !=
_glfw.x11.root)
1537 if (
_glfw.x11.errorCode == BadWindow)
1541 if (xpos != window->x11.xpos || ypos != window->x11.ypos)
1544 window->x11.xpos = xpos;
1545 window->x11.ypos = ypos;
1558 if (event->xclient.message_type == None)
1561 if (event->xclient.message_type ==
_glfw.x11.WM_PROTOCOLS)
1563 const Atom protocol =
event->xclient.data.l[0];
1564 if (protocol == None)
1567 if (protocol ==
_glfw.x11.WM_DELETE_WINDOW)
1574 else if (protocol ==
_glfw.x11.NET_WM_PING)
1579 XEvent reply = *event;
1580 reply.xclient.window =
_glfw.x11.root;
1584 SubstructureNotifyMask | SubstructureRedirectMask,
1588 else if (event->xclient.message_type ==
_glfw.x11.XdndEnter)
1591 unsigned long i, count;
1592 Atom* formats =
NULL;
1593 const GLFWbool list =
event->xclient.data.l[1] & 1;
1595 _glfw.x11.xdnd.source =
event->xclient.data.l[0];
1596 _glfw.x11.xdnd.version =
event->xclient.data.l[1] >> 24;
1597 _glfw.x11.xdnd.format = None;
1605 _glfw.x11.XdndTypeList,
1607 (
unsigned char**) &formats);
1612 formats = (Atom*) event->xclient.data.l + 2;
1615 for (i = 0; i < count; i++)
1617 if (formats[i] ==
_glfw.x11.text_uri_list)
1619 _glfw.x11.xdnd.format =
_glfw.x11.text_uri_list;
1624 if (list && formats)
1627 else if (event->xclient.message_type ==
_glfw.x11.XdndDrop)
1630 Time time = CurrentTime;
1635 if (
_glfw.x11.xdnd.format)
1637 if (
_glfw.x11.xdnd.version >= 1)
1638 time =
event->xclient.data.l[2];
1642 _glfw.x11.XdndSelection,
1643 _glfw.x11.xdnd.format,
1644 _glfw.x11.XdndSelection,
1648 else if (
_glfw.x11.xdnd.version >= 2)
1650 XEvent reply = { 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;
1659 False, NoEventMask, &reply);
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;
1683 XEvent reply = { ClientMessage };
1684 reply.xclient.window =
_glfw.x11.xdnd.source;
1685 reply.xclient.message_type =
_glfw.x11.XdndStatus;
1686 reply.xclient.format = 32;
1687 reply.xclient.data.l[0] = window->x11.
handle;
1688 reply.xclient.data.l[2] = 0;
1689 reply.xclient.data.l[3] = 0;
1691 if (
_glfw.x11.xdnd.format)
1694 reply.xclient.data.l[1] = 1;
1695 if (
_glfw.x11.xdnd.version >= 2)
1696 reply.xclient.data.l[4] =
_glfw.x11.XdndActionCopy;
1700 False, NoEventMask, &reply);
1707 case SelectionNotify:
1709 if (event->xselection.property ==
_glfw.x11.XdndSelection)
1713 const unsigned long result =
1715 event->xselection.property,
1716 event->xselection.target,
1717 (
unsigned char**) &data);
1722 char** paths = parseUriList(data, &count);
1726 for (i = 0; i < count; i++)
1734 if (
_glfw.x11.xdnd.version >= 2)
1736 XEvent reply = { ClientMessage };
1737 reply.xclient.window =
_glfw.x11.xdnd.source;
1738 reply.xclient.message_type =
_glfw.x11.XdndFinished;
1739 reply.xclient.format = 32;
1740 reply.xclient.data.l[0] = window->x11.
handle;
1741 reply.xclient.data.l[1] = result;
1742 reply.xclient.data.l[2] =
_glfw.x11.XdndActionCopy;
1745 False, NoEventMask, &reply);
1755 if (event->xfocus.mode == NotifyGrab ||
1756 event->xfocus.mode == NotifyUngrab)
1764 disableCursor(window);
1775 if (event->xfocus.mode == NotifyGrab ||
1776 event->xfocus.mode == NotifyUngrab)
1784 enableCursor(window);
1789 if (window->monitor && window->autoIconify)
1802 case PropertyNotify:
1804 if (event->xproperty.state != PropertyNewValue)
1807 if (event->xproperty.atom ==
_glfw.x11.WM_STATE)
1809 const int state = getWindowState(window);
1810 if (state != IconicState && state != NormalState)
1813 const GLFWbool iconified = (state == IconicState);
1814 if (window->x11.iconified != iconified)
1816 if (window->monitor)
1819 releaseMonitor(window);
1821 acquireMonitor(window);
1824 window->x11.iconified = iconified;
1828 else if (event->xproperty.atom ==
_glfw.x11.NET_WM_STATE)
1831 if (window->x11.maximized != maximized)
1833 window->x11.maximized = maximized;
1857 unsigned char** value)
1861 unsigned long itemCount, bytesAfter;
1885 return pf && pf->direct.alphaMask;
1893 _glfw.x11.CLIPBOARD_MANAGER,
1894 _glfw.x11.SAVE_TARGETS,
1896 _glfw.x11.helperWindowHandle,
1907 case SelectionRequest:
1908 handleSelectionRequest(&event);
1911 case SelectionClear:
1912 handleSelectionClear(&event);
1915 case SelectionNotify:
1917 if (event.xselection.target ==
_glfw.x11.SAVE_TARGETS)
1938 XIMCallback callback;
1939 callback.callback = (XIMProc) inputContextDestroyCallback;
1940 callback.client_data = (XPointer) window;
1944 XIMPreeditNothing | XIMStatusNothing,
1955 XWindowAttributes attribs;
1958 unsigned long filter = 0;
1963 attribs.your_event_mask | filter);
1978 Visual* visual =
NULL;
1994 if (!_glfwChooseVisualEGL(wndconfig, ctxconfig, fbconfig, &visual, &depth))
2006 visual = DefaultVisual(
_glfw.x11.display,
_glfw.x11.screen);
2007 depth = DefaultDepth(
_glfw.x11.display,
_glfw.x11.screen);
2010 if (!createNativeWindow(window, wndconfig, visual, depth))
2035 updateWindowMode(window);
2036 acquireMonitor(window);
2045 if (
_glfw.x11.disabledCursorWindow == window)
2049 releaseMonitor(window);
2054 window->x11.ic =
NULL;
2060 if (window->x11.handle)
2065 window->x11.handle = (Window) 0;
2068 if (window->x11.colormap)
2071 window->x11.colormap = (Colormap) 0;
2079 if (
_glfw.x11.xlib.utf8)
2089 _glfw.x11.NET_WM_NAME,
_glfw.x11.UTF8_STRING, 8,
2091 (
unsigned char*) title, strlen(title));
2094 _glfw.x11.NET_WM_ICON_NAME,
_glfw.x11.UTF8_STRING, 8,
2096 (
unsigned char*) title, strlen(title));
2106 int i, j, longCount = 0;
2108 for (i = 0; i < count; i++)
2109 longCount += 2 + images[i].width * images[i].height;
2111 long* icon = calloc(longCount,
sizeof(
long));
2112 long* target = icon;
2114 for (i = 0; i < count; i++)
2116 *target++ = images[i].
width;
2117 *target++ = images[i].
height;
2119 for (j = 0; j < images[i].
width * images[i].
height; j++)
2121 *target++ = (images[i].
pixels[j * 4 + 0] << 16) |
2122 (images[i].pixels[j * 4 + 1] << 8) |
2123 (images[i].
pixels[j * 4 + 2] << 0) |
2124 (images[i].pixels[j * 4 + 3] << 24);
2129 _glfw.x11.NET_WM_ICON,
2132 (
unsigned char*) icon,
2140 _glfw.x11.NET_WM_ICON);
2152 0, 0, &x, &y, &dummy);
2171 hints->flags |= PPosition;
2172 hints->x = hints->y = 0;
2186 XWindowAttributes attribs;
2190 *width = attribs.width;
2192 *height = attribs.height;
2200 acquireMonitor(window);
2205 updateNormalHints(window, width, height);
2214 int minwidth,
int minheight,
2215 int maxwidth,
int maxheight)
2219 updateNormalHints(window, width, height);
2227 updateNormalHints(window, width, height);
2237 int* left,
int* top,
2238 int* right,
int* bottom)
2240 long* extents =
NULL;
2245 if (
_glfw.x11.NET_FRAME_EXTENTS == None)
2249 _glfw.x11.NET_REQUEST_FRAME_EXTENTS)
2252 double timeout = 0.5;
2256 sendEventToWM(window,
_glfw.x11.NET_REQUEST_FRAME_EXTENTS,
2266 isFrameExtentsEvent,
2269 if (!waitForEvent(&timeout))
2272 "X11: The window manager has a broken _NET_REQUEST_FRAME_EXTENTS implementation; please report this issue");
2279 _glfw.x11.NET_FRAME_EXTENTS,
2281 (
unsigned char**) &extents) == 4)
2288 *right = extents[1];
2290 *bottom = extents[3];
2298 float* xscale,
float* yscale)
2301 *xscale =
_glfw.x11.contentScaleX;
2303 *yscale =
_glfw.x11.contentScaleY;
2308 if (window->x11.overrideRedirect)
2313 "X11: Iconification of full screen windows requires a WM that supports EWMH full screen");
2323 if (window->x11.overrideRedirect)
2328 "X11: Iconification of full screen windows requires a WM that supports EWMH full screen");
2335 waitForVisibilityNotify(window);
2339 if (
_glfw.x11.NET_WM_STATE &&
2340 _glfw.x11.NET_WM_STATE_MAXIMIZED_VERT &&
2341 _glfw.x11.NET_WM_STATE_MAXIMIZED_HORZ)
2343 sendEventToWM(window,
2344 _glfw.x11.NET_WM_STATE,
2346 _glfw.x11.NET_WM_STATE_MAXIMIZED_VERT,
2347 _glfw.x11.NET_WM_STATE_MAXIMIZED_HORZ,
2357 if (!
_glfw.x11.NET_WM_STATE ||
2358 !
_glfw.x11.NET_WM_STATE_MAXIMIZED_VERT ||
2359 !
_glfw.x11.NET_WM_STATE_MAXIMIZED_HORZ)
2366 sendEventToWM(window,
2367 _glfw.x11.NET_WM_STATE,
2369 _glfw.x11.NET_WM_STATE_MAXIMIZED_VERT,
2370 _glfw.x11.NET_WM_STATE_MAXIMIZED_HORZ,
2375 Atom* states =
NULL;
2376 unsigned long count =
2378 _glfw.x11.NET_WM_STATE,
2380 (
unsigned char**) &states);
2387 _glfw.x11.NET_WM_STATE_MAXIMIZED_VERT,
2388 _glfw.x11.NET_WM_STATE_MAXIMIZED_HORZ
2390 unsigned long missingCount = 2;
2392 for (
unsigned long i = 0; i < count; i++)
2394 for (
unsigned long j = 0; j < missingCount; j++)
2396 if (states[i] == missing[j])
2398 missing[j] = missing[missingCount - 1];
2411 _glfw.x11.NET_WM_STATE, XA_ATOM, 32,
2413 (
unsigned char*) missing,
2426 waitForVisibilityNotify(window);
2437 if (!
_glfw.x11.NET_WM_STATE || !
_glfw.x11.NET_WM_STATE_DEMANDS_ATTENTION)
2440 sendEventToWM(window,
2441 _glfw.x11.NET_WM_STATE,
2443 _glfw.x11.NET_WM_STATE_DEMANDS_ATTENTION,
2449 if (
_glfw.x11.NET_ACTIVE_WINDOW)
2450 sendEventToWM(window,
_glfw.x11.NET_ACTIVE_WINDOW, 1, 0, 0, 0, 0);
2455 RevertToParent, CurrentTime);
2464 int width,
int height,
2467 if (window->
monitor == monitor)
2471 if (monitor->
window == window)
2472 acquireMonitor(window);
2477 updateNormalHints(window, width, height);
2480 xpos, ypos, width, height);
2491 releaseMonitor(window);
2495 updateNormalHints(window, width, height);
2502 waitForVisibilityNotify(window);
2505 updateWindowMode(window);
2506 acquireMonitor(window);
2510 updateWindowMode(window);
2512 xpos, ypos, width, height);
2524 return window->x11.handle == focused;
2529 return getWindowState(window) == IconicState;
2534 XWindowAttributes wa;
2536 return wa.map_state == IsViewable;
2545 if (!
_glfw.x11.NET_WM_STATE ||
2546 !
_glfw.x11.NET_WM_STATE_MAXIMIZED_VERT ||
2547 !
_glfw.x11.NET_WM_STATE_MAXIMIZED_HORZ)
2552 const unsigned long count =
2554 _glfw.x11.NET_WM_STATE,
2556 (
unsigned char**) &states);
2558 for (i = 0; i < count; i++)
2560 if (states[i] ==
_glfw.x11.NET_WM_STATE_MAXIMIZED_VERT ||
2561 states[i] ==
_glfw.x11.NET_WM_STATE_MAXIMIZED_HORZ)
2576 Window w =
_glfw.x11.root;
2580 int rootX, rootY, childX, childY;
2586 &root, &w, &rootX, &rootY,
2587 &childX, &childY, &mask);
2591 if (
_glfw.x11.errorCode == BadWindow)
2595 else if (w == window->x11.handle)
2604 if (!window->x11.transparent)
2614 updateNormalHints(window, width, height);
2621 unsigned long flags;
2622 unsigned long functions;
2623 unsigned long decorations;
2625 unsigned long status;
2632 _glfw.x11.MOTIF_WM_HINTS,
2633 _glfw.x11.MOTIF_WM_HINTS, 32,
2635 (
unsigned char*) &hints,
2636 sizeof(hints) /
sizeof(
long));
2641 if (!
_glfw.x11.NET_WM_STATE || !
_glfw.x11.NET_WM_STATE_ABOVE)
2647 sendEventToWM(window,
2648 _glfw.x11.NET_WM_STATE,
2650 _glfw.x11.NET_WM_STATE_ABOVE,
2655 Atom* states =
NULL;
2656 unsigned long i, count;
2659 _glfw.x11.NET_WM_STATE,
2661 (
unsigned char**) &states);
2668 for (i = 0; i < count; i++)
2670 if (states[i] ==
_glfw.x11.NET_WM_STATE_ABOVE)
2678 _glfw.x11.NET_WM_STATE, XA_ATOM, 32,
2680 (
unsigned char*) &
_glfw.x11.NET_WM_STATE_ABOVE,
2685 for (i = 0; i < count; i++)
2687 if (states[i] ==
_glfw.x11.NET_WM_STATE_ABOVE)
2694 states[i] = states[count - 1];
2698 _glfw.x11.NET_WM_STATE, XA_ATOM, 32,
2699 PropModeReplace, (
unsigned char*) states, count);
2718 ShapeInput, 0, 0, region, ShapeSet);
2724 ShapeInput, 0, 0, None, ShapeSet);
2730 float opacity = 1.f;
2734 CARD32* value =
NULL;
2737 _glfw.x11.NET_WM_WINDOW_OPACITY,
2739 (
unsigned char**) &value))
2741 opacity = (float) (*value / (
double) 0xffffffffu);
2753 const CARD32 value = (CARD32) (0xffffffffu * (
double) opacity);
2755 _glfw.x11.NET_WM_WINDOW_OPACITY, XA_CARDINAL, 32,
2756 PropModeReplace, (
unsigned char*) &value, 1);
2764 if (
_glfw.x11.disabledCursorWindow != window)
2768 enableRawMouseMotion(window);
2770 disableRawMouseMotion(window);
2782#if defined(__linux__)
2788 while (QLength(
_glfw.x11.display))
2792 processEvent(&event);
2795 window =
_glfw.x11.disabledCursorWindow;
2803 if (window->x11.lastCursorPosX != width / 2 ||
2804 window->x11.lastCursorPosY != height / 2)
2825 if (!waitForEvent(&timeout))
2834 XEvent
event = { ClientMessage };
2835 event.xclient.window =
_glfw.x11.helperWindowHandle;
2836 event.xclient.format = 32;
2837 event.xclient.message_type =
_glfw.x11.NULL_;
2846 int rootX, rootY, childX, childY;
2851 &rootX, &rootY, &childX, &childY,
2863 window->x11.warpCursorPosX = (int) x;
2864 window->x11.warpCursorPosY = (int) y;
2867 0,0,0,0, (
int) x, (
int) y);
2876 disableCursor(window);
2878 else if (
_glfw.x11.disabledCursorWindow == window)
2879 enableCursor(window);
2881 updateCursorImage(window);
2891 if (scancode < 0 || scancode > 0xff ||
2898 const int key =
_glfw.x11.keycodes[scancode];
2900 scancode,
_glfw.x11.xkb.group, 0);
2901 if (keysym == NoSymbol)
2908 const size_t count = encodeUTF8(
_glfw.x11.keynames[key], (
unsigned int) ch);
2912 _glfw.x11.keynames[key][count] =
'\0';
2913 return _glfw.x11.keynames[key];
2918 return _glfw.x11.scancodes[key];
2926 if (!cursor->x11.handle)
2940 const char* name =
NULL;
2963 name =
"nwse-resize";
2966 name =
"nesw-resize";
2969 name =
"all-scroll";
2972 name =
"not-allowed";
2985 if (!cursor->x11.handle)
2987 unsigned int native = 0;
2992 native = XC_left_ptr;
2998 native = XC_crosshair;
3004 native = XC_sb_h_double_arrow;
3007 native = XC_sb_v_double_arrow;
3014 "X11: Standard cursor shape unavailable");
3019 if (!cursor->x11.handle)
3022 "X11: Failed to create standard cursor");
3032 if (cursor->x11.handle)
3040 updateCursorImage(window);
3048 free(
_glfw.x11.clipboardString);
3049 _glfw.x11.clipboardString = copy;
3052 _glfw.x11.CLIPBOARD,
3053 _glfw.x11.helperWindowHandle,
3057 _glfw.x11.helperWindowHandle)
3060 "X11: Failed to become owner of clipboard selection");
3066 return getSelectionString(
_glfw.x11.CLIPBOARD);
3089 *attribs = calloc(5,
sizeof(
EGLint));
3091 (*attribs)[1] = type;
3107 return _glfw.x11.display;
3113 return &window->x11.handle;
3125 if (!
_glfw.
vk.KHR_xlib_surface)
3129 extensions[0] =
"VK_KHR_surface";
3134 extensions[1] =
"VK_KHR_xcb_surface";
3136 extensions[1] =
"VK_KHR_xlib_surface";
3149 vkGetPhysicalDeviceXcbPresentationSupportKHR =
3152 if (!vkGetPhysicalDeviceXcbPresentationSupportKHR)
3155 "X11: Vulkan instance missing VK_KHR_xcb_surface extension");
3163 "X11: Failed to retrieve XCB connection");
3167 return vkGetPhysicalDeviceXcbPresentationSupportKHR(device,
3175 vkGetPhysicalDeviceXlibPresentationSupportKHR =
3178 if (!vkGetPhysicalDeviceXlibPresentationSupportKHR)
3181 "X11: Vulkan instance missing VK_KHR_xlib_surface extension");
3185 return vkGetPhysicalDeviceXlibPresentationSupportKHR(device,
3207 "X11: Failed to retrieve XCB connection");
3213 if (!vkCreateXcbSurfaceKHR)
3216 "X11: Vulkan instance missing VK_KHR_xcb_surface extension");
3220 memset(&sci, 0,
sizeof(sci));
3223 sci.
window = window->x11.handle;
3225 err = vkCreateXcbSurfaceKHR(instance, &sci, allocator, surface);
3229 "X11: Failed to create Vulkan XCB surface: %s",
3243 if (!vkCreateXlibSurfaceKHR)
3246 "X11: Vulkan instance missing VK_KHR_xlib_surface extension");
3250 memset(&sci, 0,
sizeof(sci));
3253 sci.
window = window->x11.handle;
3255 err = vkCreateXlibSurfaceKHR(instance, &sci, allocator, surface);
3259 "X11: Failed to create Vulkan X11 surface: %s",
3275 return _glfw.x11.display;
3282 return window->x11.handle;
3289 free(
_glfw.x11.primarySelectionString);
3294 _glfw.x11.helperWindowHandle,
3298 _glfw.x11.helperWindowHandle)
3301 "X11: Failed to become owner of primary selection");
3308 return getSelectionString(
_glfw.x11.PRIMARY);
void _glfwPlatformGetVideoMode(_GLFWmonitor *monitor, GLFWvidmode *mode)
void _glfwPlatformGetMonitorPos(_GLFWmonitor *monitor, int *xpos, int *ypos)
uint64_t _glfwPlatformGetTimerValue(void)
uint64_t _glfwPlatformGetTimerFrequency(void)
GLFWbool _glfwInitEGL(void)
GLFWbool _glfwCreateContextEGL(_GLFWwindow *window, const _GLFWctxconfig *ctxconfig, const _GLFWfbconfig *fbconfig)
#define EGL_PLATFORM_ANGLE_TYPE_ANGLE
#define EGL_PLATFORM_X11_EXT
#define EGL_PLATFORM_ANGLE_TYPE_OPENGL_ANGLE
void * EGLNativeDisplayType
void * EGLNativeWindowType
#define EGL_PLATFORM_ANGLE_TYPE_VULKAN_ANGLE
#define EGL_PLATFORM_ANGLE_NATIVE_PLATFORM_TYPE_ANGLE
#define EGL_PLATFORM_ANGLE_ANGLE
#define GLFW_EGL_CONTEXT_API
#define GLFW_NATIVE_CONTEXT_API
#define GLFW_CURSOR_DISABLED
#define GLFW_ANGLE_PLATFORM_TYPE_VULKAN
#define GLFW_CURSOR_HIDDEN
#define GLFW_ANGLE_PLATFORM_TYPE_OPENGL
#define GLFW_CURSOR_NORMAL
#define GLFW_OSMESA_CONTEXT_API
GLFWbool _glfwCreateContextGLX(_GLFWwindow *window, const _GLFWctxconfig *ctxconfig, const _GLFWfbconfig *fbconfig)
GLFWbool _glfwChooseVisualGLX(const _GLFWwndconfig *wndconfig, const _GLFWctxconfig *ctxconfig, const _GLFWfbconfig *fbconfig, Visual **visual, int *depth)
GLFWbool _glfwInitGLX(void)
#define GLFW_CURSOR_UNAVAILABLE
The specified cursor shape is not available.
#define GLFW_FORMAT_UNAVAILABLE
The requested format is not supported or available.
#define GLFW_API_UNAVAILABLE
GLFW could not find support for the requested API on the system.
#define GLFW_OUT_OF_MEMORY
A memory allocation failed.
#define GLFW_INVALID_VALUE
One of the arguments to the function was an invalid value.
#define GLFW_PLATFORM_ERROR
A platform-specific error occurred that does not match any of the more specific categories.
#define GLFW_MOD_SHIFT
If this bit is set one or more Shift keys were held down.
#define GLFW_MOD_NUM_LOCK
If this bit is set the Num Lock key is enabled.
#define GLFW_MOD_SUPER
If this bit is set one or more Super keys were held down.
#define GLFW_MOD_CONTROL
If this bit is set one or more Control keys were held down.
#define GLFW_MOD_ALT
If this bit is set one or more Alt keys were held down.
#define GLFW_MOD_CAPS_LOCK
If this bit is set the Caps Lock key is enabled.
#define GLFW_RESIZE_EW_CURSOR
The horizontal resize/move arrow shape.
#define GLFW_NOT_ALLOWED_CURSOR
The operation-not-allowed shape.
#define GLFW_IBEAM_CURSOR
The text input I-beam cursor shape.
#define GLFW_RESIZE_ALL_CURSOR
The omni-directional resize/move cursor shape.
#define GLFW_ARROW_CURSOR
The regular arrow cursor shape.
#define GLFW_CROSSHAIR_CURSOR
The crosshair cursor shape.
#define GLFW_RESIZE_NS_CURSOR
The vertical resize/move arrow shape.
#define GLFW_POINTING_HAND_CURSOR
The pointing hand cursor shape.
#define GLFW_RESIZE_NESW_CURSOR
The top-right to bottom-left diagonal resize/move arrow shape.
#define GLFW_RESIZE_NWSE_CURSOR
The top-left to bottom-right diagonal resize/move arrow shape.
struct GLFWwindow GLFWwindow
Opaque window object.
void _glfwInputError(int code, const char *format,...)
char * _glfw_strdup(const char *source)
void _glfwInputMonitorWindow(_GLFWmonitor *monitor, _GLFWwindow *window)
void _glfwInputFramebufferSize(_GLFWwindow *window, int width, int height)
void _glfwInputWindowIconify(_GLFWwindow *window, GLFWbool iconified)
void _glfwInputWindowMaximize(_GLFWwindow *window, GLFWbool maximized)
void _glfwInputWindowSize(_GLFWwindow *window, int width, int height)
void _glfwInputWindowMonitor(_GLFWwindow *window, _GLFWmonitor *monitor)
#define _GLFW_REQUIRE_INIT_OR_RETURN(x)
void _glfwInputWindowPos(_GLFWwindow *window, int xpos, int ypos)
const char * _glfwGetVulkanResultString(VkResult result)
void _glfwInputWindowDamage(_GLFWwindow *window)
void _glfwInputWindowCloseRequest(_GLFWwindow *window)
#define _GLFW_REQUIRE_INIT()
void _glfwInputWindowFocus(_GLFWwindow *window, GLFWbool focused)
@ VK_STRUCTURE_TYPE_XLIB_SURFACE_CREATE_INFO_KHR
@ VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR
void _glfwDetectJoystickConnectionLinux(void)
GLFWbool _glfwCreateContextOSMesa(_GLFWwindow *window, const _GLFWctxconfig *ctxconfig, const _GLFWfbconfig *fbconfig)
GLFWbool _glfwInitOSMesa(void)
unsigned __int64 uint64_t
_GLFWdestroycontextfun destroy
GLFWbool EXT_platform_base
GLFWbool ANGLE_platform_angle
GLFWbool ANGLE_platform_angle_vulkan
GLFWbool EXT_platform_x11
GLFWbool ANGLE_platform_angle_opengl
struct _GLFWlibrary::@25 vk
GLFWbool joysticksInitialized
struct _GLFWlibrary::@23 hints
struct _GLFWwndconfig::@19 x11
xcb_connection_t * connection
@ VK_ERROR_EXTENSION_NOT_PRESENT
#define vkGetInstanceProcAddr
void _glfwInputErrorX11(int error, const char *message)
void _glfwReleaseErrorHandlerX11(void)
void _glfwGrabErrorHandlerX11(void)
Cursor _glfwCreateCursorX11(const GLFWimage *image, int xhot, int yhot)
void _glfwRestoreVideoModeX11(_GLFWmonitor *monitor)
void _glfwSetVideoModeX11(_GLFWmonitor *monitor, const GLFWvidmode *desired)
void _glfwPollMonitorsX11(void)
void _glfwPlatformSetWindowMonitor(_GLFWwindow *window, _GLFWmonitor *monitor, int xpos, int ypos, int width, int height, int refreshRate)
void _glfwPlatformSetWindowPos(_GLFWwindow *window, int xpos, int ypos)
void _glfwPlatformGetWindowContentScale(_GLFWwindow *window, float *xscale, float *yscale)
GLFWAPI Display * glfwGetX11Display(void)
#define _GLFW_XDND_VERSION
void _glfwPlatformSetCursorPos(_GLFWwindow *window, double x, double y)
void _glfwPlatformSetWindowResizable(_GLFWwindow *window, GLFWbool enabled)
int _glfwPlatformWindowIconified(_GLFWwindow *window)
void _glfwPlatformMaximizeWindow(_GLFWwindow *window)
EGLenum _glfwPlatformGetEGLPlatform(EGLint **attribs)
void _glfwPlatformIconifyWindow(_GLFWwindow *window)
void _glfwPlatformSetWindowSize(_GLFWwindow *window, int width, int height)
void _glfwPlatformWaitEvents(void)
void _glfwPlatformSetWindowSizeLimits(_GLFWwindow *window, int minwidth, int minheight, int maxwidth, int maxheight)
void _glfwPlatformGetRequiredInstanceExtensions(char **extensions)
VkResult _glfwPlatformCreateWindowSurface(VkInstance instance, _GLFWwindow *window, const VkAllocationCallbacks *allocator, VkSurfaceKHR *surface)
int _glfwPlatformFramebufferTransparent(_GLFWwindow *window)
int _glfwPlatformCreateCursor(_GLFWcursor *cursor, const GLFWimage *image, int xhot, int yhot)
void _glfwPlatformPollEvents(void)
void _glfwPlatformGetFramebufferSize(_GLFWwindow *window, int *width, int *height)
#define MWM_HINTS_DECORATIONS
int _glfwPlatformWindowVisible(_GLFWwindow *window)
GLFWAPI void glfwSetX11SelectionString(const char *string)
#define _NET_WM_STATE_REMOVE
void _glfwPlatformSetCursor(_GLFWwindow *window, _GLFWcursor *cursor)
void _glfwPlatformGetWindowSize(_GLFWwindow *window, int *width, int *height)
void _glfwPlatformGetWindowFrameSize(_GLFWwindow *window, int *left, int *top, int *right, int *bottom)
void _glfwPlatformSetWindowIcon(_GLFWwindow *window, int count, const GLFWimage *images)
EGLNativeWindowType _glfwPlatformGetEGLNativeWindow(_GLFWwindow *window)
const char * _glfwPlatformGetScancodeName(int scancode)
void _glfwPlatformSetWindowDecorated(_GLFWwindow *window, GLFWbool enabled)
void _glfwPlatformGetWindowPos(_GLFWwindow *window, int *xpos, int *ypos)
void _glfwPlatformSetWindowOpacity(_GLFWwindow *window, float opacity)
float _glfwPlatformGetWindowOpacity(_GLFWwindow *window)
void _glfwPlatformDestroyCursor(_GLFWcursor *cursor)
void _glfwPlatformRestoreWindow(_GLFWwindow *window)
GLFWbool _glfwPlatformRawMouseMotionSupported(void)
void _glfwPlatformSetCursorMode(_GLFWwindow *window, int mode)
unsigned long _glfwGetWindowPropertyX11(Window window, Atom property, Atom type, unsigned char **value)
int _glfwPlatformWindowHovered(_GLFWwindow *window)
void _glfwPlatformDestroyWindow(_GLFWwindow *window)
void _glfwPlatformWaitEventsTimeout(double timeout)
void _glfwPlatformHideWindow(_GLFWwindow *window)
GLFWAPI Window glfwGetX11Window(GLFWwindow *handle)
int _glfwPlatformGetPhysicalDevicePresentationSupport(VkInstance instance, VkPhysicalDevice device, uint32_t queuefamily)
int _glfwPlatformWindowMaximized(_GLFWwindow *window)
GLFWbool _glfwIsVisualTransparentX11(Visual *visual)
void _glfwPlatformSetClipboardString(const char *string)
void _glfwPlatformShowWindow(_GLFWwindow *window)
void _glfwPlatformSetRawMouseMotion(_GLFWwindow *window, GLFWbool enabled)
int _glfwPlatformWindowFocused(_GLFWwindow *window)
void _glfwPlatformPostEmptyEvent(void)
int _glfwPlatformGetKeyScancode(int key)
int _glfwPlatformCreateStandardCursor(_GLFWcursor *cursor, int shape)
GLFWAPI const char * glfwGetX11SelectionString(void)
void _glfwCreateInputContextX11(_GLFWwindow *window)
int _glfwPlatformCreateWindow(_GLFWwindow *window, const _GLFWwndconfig *wndconfig, const _GLFWctxconfig *ctxconfig, const _GLFWfbconfig *fbconfig)
void _glfwPlatformSetWindowAspectRatio(_GLFWwindow *window, int numer, int denom)
const char * _glfwPlatformGetClipboardString(void)
void _glfwPlatformGetCursorPos(_GLFWwindow *window, double *xpos, double *ypos)
void _glfwPlatformRequestWindowAttention(_GLFWwindow *window)
void _glfwPushSelectionToManagerX11(void)
EGLNativeDisplayType _glfwPlatformGetEGLNativeDisplay(void)
void _glfwPlatformSetWindowTitle(_GLFWwindow *window, const char *title)
void _glfwPlatformFocusWindow(_GLFWwindow *window)
#define _NET_WM_STATE_ADD
void _glfwPlatformSetWindowMousePassthrough(_GLFWwindow *window, GLFWbool enabled)
void _glfwPlatformSetWindowFloating(_GLFWwindow *window, GLFWbool enabled)
long _glfwKeySym2Unicode(unsigned int keysym)