From 75a6d875424319b36a7f628b327fc1dd301e5f6d Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Wed, 28 Jan 2015 00:04:59 +0100 Subject: [PATCH] Added support for Cygwin-X. Fixes #406. --- README.md | 1 + src/x11_init.c | 2 +- src/x11_platform.h | 2 +- src/x11_window.c | 5 +++-- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 00e4c5c7..f31e14b5 100644 --- a/README.md +++ b/README.md @@ -64,6 +64,7 @@ GLFW bundles a number of dependencies in the `deps/` directory. - [Cocoa] Bugfix: `glfwSetWindowSize` did not change the video mode for full screen windows + - [X11] Added support for Cygwin-X - [X11] Made XInput2 optional at compile-time - [X11] Made Xxf86vm optional at compile-time diff --git a/src/x11_init.c b/src/x11_init.c index dc33bcee..8a00eb84 100644 --- a/src/x11_init.c +++ b/src/x11_init.c @@ -587,7 +587,7 @@ static GLboolean initExtensions(void) detectEWMH(); // Find or create string format atoms - _glfw.x11._NULL = XInternAtom(_glfw.x11.display, "NULL", False); + _glfw.x11.NULL_ = XInternAtom(_glfw.x11.display, "NULL", False); _glfw.x11.UTF8_STRING = XInternAtom(_glfw.x11.display, "UTF8_STRING", False); _glfw.x11.COMPOUND_STRING = diff --git a/src/x11_platform.h b/src/x11_platform.h index 0c6450b3..22bb7e0d 100644 --- a/src/x11_platform.h +++ b/src/x11_platform.h @@ -160,7 +160,7 @@ typedef struct _GLFWlibraryX11 Atom CLIPBOARD; Atom CLIPBOARD_MANAGER; Atom SAVE_TARGETS; - Atom _NULL; + Atom NULL_; Atom UTF8_STRING; Atom COMPOUND_STRING; Atom ATOM_PAIR; diff --git a/src/x11_window.c b/src/x11_window.c index 77a34597..359c7d45 100644 --- a/src/x11_window.c +++ b/src/x11_window.c @@ -28,6 +28,7 @@ #include "internal.h" #include +#include #include @@ -632,7 +633,7 @@ static Atom writeTargetToProperty(const XSelectionRequestEvent* request) XChangeProperty(_glfw.x11.display, request->requestor, request->property, - _glfw.x11._NULL, + _glfw.x11.NULL_, 32, PropModeReplace, NULL, @@ -1739,7 +1740,7 @@ void _glfwPlatformPostEmptyEvent(void) event.type = ClientMessage; event.xclient.window = window->x11.handle; event.xclient.format = 32; // Data is 32-bit longs - event.xclient.message_type = _glfw.x11._NULL; + event.xclient.message_type = _glfw.x11.NULL_; XSendEvent(_glfw.x11.display, window->x11.handle, False, 0, &event); XFlush(_glfw.x11.display);