Merge branch '3.3-stable' into new-cursors-on-3.3-stable

This commit is contained in:
Camilla Löwy 2020-07-02 23:24:20 +02:00
commit 0ebae5a3df
10 changed files with 97 additions and 36 deletions

View File

@ -9,7 +9,6 @@ matrix:
include: include:
- os: linux - os: linux
dist: xenial dist: xenial
sudo: false
name: "X11 shared library" name: "X11 shared library"
addons: addons:
apt: apt:
@ -23,7 +22,6 @@ matrix:
- CFLAGS=-Werror - CFLAGS=-Werror
- os: linux - os: linux
dist: xenial dist: xenial
sudo: false
name: "X11 static library" name: "X11 static library"
addons: addons:
apt: apt:
@ -37,7 +35,6 @@ matrix:
- CFLAGS=-Werror - CFLAGS=-Werror
- os: linux - os: linux
dist: xenial dist: xenial
sudo: required
name: "Wayland shared library" name: "Wayland shared library"
addons: addons:
apt: apt:
@ -54,7 +51,6 @@ matrix:
- CFLAGS=-Werror - CFLAGS=-Werror
- os: linux - os: linux
dist: xenial dist: xenial
sudo: required
name: "Wayland static library" name: "Wayland static library"
addons: addons:
apt: apt:
@ -92,14 +88,12 @@ matrix:
- USE_OSMESA=ON - USE_OSMESA=ON
- CFLAGS=-Werror - CFLAGS=-Werror
- os: osx - os: osx
sudo: false
name: "Cocoa shared library" name: "Cocoa shared library"
env: env:
- BUILD_SHARED_LIBS=ON - BUILD_SHARED_LIBS=ON
- CFLAGS=-Werror - CFLAGS=-Werror
- MACOSX_DEPLOYMENT_TARGET=10.8 - MACOSX_DEPLOYMENT_TARGET=10.8
- os: osx - os: osx
sudo: false
name: "Cocoa static library" name: "Cocoa static library"
env: env:
- BUILD_SHARED_LIBS=OFF - BUILD_SHARED_LIBS=OFF

View File

@ -128,6 +128,9 @@ if (MINGW)
if (_GLFW_HAS_64ASLR) if (_GLFW_HAS_64ASLR)
set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--high-entropy-va ${CMAKE_SHARED_LINKER_FLAGS}") set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--high-entropy-va ${CMAKE_SHARED_LINKER_FLAGS}")
endif() endif()
# Clear flags again to avoid breaking later tests
set(CMAKE_REQUIRED_FLAGS)
endif() endif()
#-------------------------------------------------------------------- #--------------------------------------------------------------------

View File

@ -125,7 +125,10 @@ information on what to include when reporting a bug.
- Added `GLFW_POINTING_HAND_CURSOR` alias for `GLFW_HAND_CURSOR` (#427) - Added `GLFW_POINTING_HAND_CURSOR` alias for `GLFW_HAND_CURSOR` (#427)
- Bugfix: Some extension loader headers did not prevent default OpenGL header - Bugfix: Some extension loader headers did not prevent default OpenGL header
inclusion (#1695) inclusion (#1695)
- [Cocoa] Use `CALayer` instead of `NSView` for `EGLNativeWindowType` (#1169) - [Win32] Bugfix: Non-BMP Unicode codepoint input was reported as UTF-16
- [Cocoa] Changed `EGLNativeWindowType` from `NSView` to `CALayer` (#1169)
- [Cocoa] Bugfix: Non-BMP Unicode codepoint input was reported as UTF-16
(#1635)
- [X11] Bugfix: IME input of CJK was broken for "C" locale (#1587,#1636) - [X11] Bugfix: IME input of CJK was broken for "C" locale (#1587,#1636)
- [X11] Bugfix: Xlib errors caused by other parts of the application could be - [X11] Bugfix: Xlib errors caused by other parts of the application could be
reported as GLFW errors reported as GLFW errors
@ -134,6 +137,7 @@ information on what to include when reporting a bug.
non-printable keys (#1598) non-printable keys (#1598)
- [X11] Bugfix: Function keys were mapped to `GLFW_KEY_UNKNOWN` for some layout - [X11] Bugfix: Function keys were mapped to `GLFW_KEY_UNKNOWN` for some layout
combinaitons (#1598) combinaitons (#1598)
- [Wayland] Bugfix: Repeated keys could be reported with `NULL` window (#1704)
## Contact ## Contact
@ -338,11 +342,14 @@ skills.
- Torsten Walluhn - Torsten Walluhn
- Patrick Walton - Patrick Walton
- Xo Wang - Xo Wang
- Waris
- Jay Weisskopf - Jay Weisskopf
- Frank Wille - Frank Wille
- Tatsuya Yatagawa
- Ryogo Yoshimura - Ryogo Yoshimura
- Lukas Zanner - Lukas Zanner
- Andrey Zholos - Andrey Zholos
- Aihui Zhu
- Santi Zupancic - Santi Zupancic
- Jonas Ådahl - Jonas Ådahl
- Lasse Öörni - Lasse Öörni

View File

@ -408,10 +408,14 @@ Forward-compatibility is described in detail in the
[OpenGL Reference Manual](https://www.opengl.org/registry/). [OpenGL Reference Manual](https://www.opengl.org/registry/).
@anchor GLFW_OPENGL_DEBUG_CONTEXT_hint @anchor GLFW_OPENGL_DEBUG_CONTEXT_hint
__GLFW_OPENGL_DEBUG_CONTEXT__ specifies whether to create a debug OpenGL __GLFW_OPENGL_DEBUG_CONTEXT__ specifies whether the context should be created
context, which may have additional error and performance issue reporting in debug mode, which may provide additional error and diagnostic reporting
functionality. Possible values are `GLFW_TRUE` and `GLFW_FALSE`. If OpenGL ES functionality. Possible values are `GLFW_TRUE` and `GLFW_FALSE`.
is requested, this hint is ignored.
@par
Debug contexts for OpenGL and OpenGL ES are described in detail by the
[GL_KHR_debug](https://www.khronos.org/registry/OpenGL/extensions/KHR/KHR_debug.txt)
extension.
@anchor GLFW_OPENGL_PROFILE_hint @anchor GLFW_OPENGL_PROFILE_hint
__GLFW_OPENGL_PROFILE__ specifies which OpenGL profile to create the context __GLFW_OPENGL_PROFILE__ specifies which OpenGL profile to create the context
@ -1328,8 +1332,8 @@ __GLFW_OPENGL_FORWARD_COMPAT__ is `GLFW_TRUE` if the window's context is an
OpenGL forward-compatible one, or `GLFW_FALSE` otherwise. OpenGL forward-compatible one, or `GLFW_FALSE` otherwise.
@anchor GLFW_OPENGL_DEBUG_CONTEXT_attrib @anchor GLFW_OPENGL_DEBUG_CONTEXT_attrib
__GLFW_OPENGL_DEBUG_CONTEXT__ is `GLFW_TRUE` if the window's context is an __GLFW_OPENGL_DEBUG_CONTEXT__ is `GLFW_TRUE` if the window's context is in debug
OpenGL debug context, or `GLFW_FALSE` otherwise. mode, or `GLFW_FALSE` otherwise.
@anchor GLFW_OPENGL_PROFILE_attrib @anchor GLFW_OPENGL_PROFILE_attrib
__GLFW_OPENGL_PROFILE__ indicates the OpenGL profile used by the context. This __GLFW_OPENGL_PROFILE__ indicates the OpenGL profile used by the context. This

View File

@ -193,6 +193,22 @@ extern "C" {
#endif /*__APPLE__*/ #endif /*__APPLE__*/
#elif defined(GLFW_INCLUDE_GLU)
#if defined(__APPLE__)
#if defined(GLFW_INCLUDE_GLU)
#include <OpenGL/glu.h>
#endif
#else /*__APPLE__*/
#if defined(GLFW_INCLUDE_GLU)
#include <GL/glu.h>
#endif
#endif /*__APPLE__*/
#elif !defined(GLFW_INCLUDE_NONE) && \ #elif !defined(GLFW_INCLUDE_NONE) && \
!defined(__gl_h_) && \ !defined(__gl_h_) && \
!defined(__gles1_gl_h_) && \ !defined(__gles1_gl_h_) && \
@ -216,9 +232,6 @@ extern "C" {
#define GL_GLEXT_LEGACY #define GL_GLEXT_LEGACY
#endif #endif
#include <OpenGL/gl.h> #include <OpenGL/gl.h>
#if defined(GLFW_INCLUDE_GLU)
#include <OpenGL/glu.h>
#endif
#else /*__APPLE__*/ #else /*__APPLE__*/
@ -226,9 +239,6 @@ extern "C" {
#if defined(GLFW_INCLUDE_GLEXT) #if defined(GLFW_INCLUDE_GLEXT)
#include <GL/glext.h> #include <GL/glext.h>
#endif #endif
#if defined(GLFW_INCLUDE_GLU)
#include <GL/glu.h>
#endif
#endif /*__APPLE__*/ #endif /*__APPLE__*/
@ -975,9 +985,9 @@ extern "C" {
* and [attribute](@ref GLFW_OPENGL_FORWARD_COMPAT_attrib). * and [attribute](@ref GLFW_OPENGL_FORWARD_COMPAT_attrib).
*/ */
#define GLFW_OPENGL_FORWARD_COMPAT 0x00022006 #define GLFW_OPENGL_FORWARD_COMPAT 0x00022006
/*! @brief OpenGL debug context hint and attribute. /*! @brief Debug mode context hint and attribute.
* *
* OpenGL debug context [hint](@ref GLFW_OPENGL_DEBUG_CONTEXT_hint) and * Debug mode context [hint](@ref GLFW_OPENGL_DEBUG_CONTEXT_hint) and
* [attribute](@ref GLFW_OPENGL_DEBUG_CONTEXT_attrib). * [attribute](@ref GLFW_OPENGL_DEBUG_CONTEXT_attrib).
*/ */
#define GLFW_OPENGL_DEBUG_CONTEXT 0x00022007 #define GLFW_OPENGL_DEBUG_CONTEXT 0x00022007

View File

@ -731,15 +731,25 @@ static const NSRange kEmptyRange = { NSNotFound, 0 };
else else
characters = (NSString*) string; characters = (NSString*) string;
const NSUInteger length = [characters length]; NSRange range = NSMakeRange(0, [characters length]);
for (NSUInteger i = 0; i < length; i++) while (range.length)
{ {
const unichar codepoint = [characters characterAtIndex:i]; uint32_t codepoint = 0;
if ((codepoint & 0xff00) == 0xf700)
if ([characters getBytes:&codepoint
maxLength:sizeof(codepoint)
usedLength:NULL
encoding:NSUTF32StringEncoding
options:0
range:range
remainingRange:&range])
{
if (codepoint >= 0xf700 && codepoint <= 0xf7ff)
continue; continue;
_glfwInputChar(window, codepoint, mods, plain); _glfwInputChar(window, codepoint, mods, plain);
} }
}
} }
- (void)doCommandBySelector:(SEL)selector - (void)doCommandBySelector:(SEL)selector

View File

@ -318,6 +318,8 @@ typedef struct _GLFWwindowWin32
// The last received cursor position, regardless of source // The last received cursor position, regardless of source
int lastCursorPosX, lastCursorPosY; int lastCursorPosX, lastCursorPosY;
// The last recevied high surrogate when decoding pairs of UTF-16 messages
WCHAR highSurrogate;
} _GLFWwindowWin32; } _GLFWwindowWin32;

View File

@ -645,11 +645,35 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg,
case WM_CHAR: case WM_CHAR:
case WM_SYSCHAR: case WM_SYSCHAR:
{
if (wParam >= 0xd800 && wParam <= 0xdbff)
window->win32.highSurrogate = (WCHAR) wParam;
else
{
unsigned int codepoint = 0;
if (wParam >= 0xdc00 && wParam <= 0xdfff)
{
if (window->win32.highSurrogate)
{
codepoint += (window->win32.highSurrogate - 0xd800) << 10;
codepoint += (WCHAR) wParam - 0xdc00;
codepoint += 0x10000;
}
}
else
codepoint = (WCHAR) wParam;
window->win32.highSurrogate = 0;
_glfwInputChar(window, codepoint, getKeyMods(), uMsg != WM_SYSCHAR);
}
return 0;
}
case WM_UNICHAR: case WM_UNICHAR:
{ {
const GLFWbool plain = (uMsg != WM_SYSCHAR); if (wParam == UNICODE_NOCHAR)
if (uMsg == WM_UNICHAR && wParam == UNICODE_NOCHAR)
{ {
// WM_UNICHAR is not sent by Windows, but is sent by some // WM_UNICHAR is not sent by Windows, but is sent by some
// third-party input method engine // third-party input method engine
@ -657,7 +681,7 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg,
return TRUE; return TRUE;
} }
_glfwInputChar(window, (unsigned int) wParam, getKeyMods(), plain); _glfwInputChar(window, (unsigned int) wParam, getKeyMods(), GLFW_TRUE);
return 0; return 0;
} }

View File

@ -870,11 +870,18 @@ static void handleEvents(int timeout)
if (read_ret != 8) if (read_ret != 8)
return; return;
if (_glfw.wl.keyboardFocus)
{
for (i = 0; i < repeats; ++i) for (i = 0; i < repeats; ++i)
_glfwInputKey(_glfw.wl.keyboardFocus, _glfw.wl.keyboardLastKey, {
_glfw.wl.keyboardLastScancode, GLFW_REPEAT, _glfwInputKey(_glfw.wl.keyboardFocus,
_glfw.wl.keyboardLastKey,
_glfw.wl.keyboardLastScancode,
GLFW_REPEAT,
_glfw.wl.xkb.modifiers); _glfw.wl.xkb.modifiers);
} }
}
}
if (fds[2].revents & POLLIN) if (fds[2].revents & POLLIN)
{ {

View File

@ -164,7 +164,7 @@ void _glfwPollMonitorsX11(void)
if (widthMM <= 0 || heightMM <= 0) if (widthMM <= 0 || heightMM <= 0)
{ {
// HACK: If RandR does not provide a physical size, assume the // HACK: If RandR does not provide a physical size, assume the
// X11 default 96 DPI and calcuate from the CRTC viewport // X11 default 96 DPI and calculate from the CRTC viewport
// NOTE: These members are affected by rotation, unlike the mode // NOTE: These members are affected by rotation, unlike the mode
// info and output info members // info and output info members
widthMM = (int) (ci->width * 25.4f / 96.f); widthMM = (int) (ci->width * 25.4f / 96.f);