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

View File

@ -128,6 +128,9 @@ if (MINGW)
if (_GLFW_HAS_64ASLR)
set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--high-entropy-va ${CMAKE_SHARED_LINKER_FLAGS}")
endif()
# Clear flags again to avoid breaking later tests
set(CMAKE_REQUIRED_FLAGS)
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)
- Bugfix: Some extension loader headers did not prevent default OpenGL header
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: Xlib errors caused by other parts of the application could be
reported as GLFW errors
@ -134,6 +137,7 @@ information on what to include when reporting a bug.
non-printable keys (#1598)
- [X11] Bugfix: Function keys were mapped to `GLFW_KEY_UNKNOWN` for some layout
combinaitons (#1598)
- [Wayland] Bugfix: Repeated keys could be reported with `NULL` window (#1704)
## Contact
@ -338,11 +342,14 @@ skills.
- Torsten Walluhn
- Patrick Walton
- Xo Wang
- Waris
- Jay Weisskopf
- Frank Wille
- Tatsuya Yatagawa
- Ryogo Yoshimura
- Lukas Zanner
- Andrey Zholos
- Aihui Zhu
- Santi Zupancic
- Jonas Ådahl
- Lasse Öörni

View File

@ -408,10 +408,14 @@ Forward-compatibility is described in detail in the
[OpenGL Reference Manual](https://www.opengl.org/registry/).
@anchor GLFW_OPENGL_DEBUG_CONTEXT_hint
__GLFW_OPENGL_DEBUG_CONTEXT__ specifies whether to create a debug OpenGL
context, which may have additional error and performance issue reporting
functionality. Possible values are `GLFW_TRUE` and `GLFW_FALSE`. If OpenGL ES
is requested, this hint is ignored.
__GLFW_OPENGL_DEBUG_CONTEXT__ specifies whether the context should be created
in debug mode, which may provide additional error and diagnostic reporting
functionality. Possible values are `GLFW_TRUE` and `GLFW_FALSE`.
@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
__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.
@anchor GLFW_OPENGL_DEBUG_CONTEXT_attrib
__GLFW_OPENGL_DEBUG_CONTEXT__ is `GLFW_TRUE` if the window's context is an
OpenGL debug context, or `GLFW_FALSE` otherwise.
__GLFW_OPENGL_DEBUG_CONTEXT__ is `GLFW_TRUE` if the window's context is in debug
mode, or `GLFW_FALSE` otherwise.
@anchor GLFW_OPENGL_PROFILE_attrib
__GLFW_OPENGL_PROFILE__ indicates the OpenGL profile used by the context. This

View File

@ -193,6 +193,22 @@ extern "C" {
#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) && \
!defined(__gl_h_) && \
!defined(__gles1_gl_h_) && \
@ -216,9 +232,6 @@ extern "C" {
#define GL_GLEXT_LEGACY
#endif
#include <OpenGL/gl.h>
#if defined(GLFW_INCLUDE_GLU)
#include <OpenGL/glu.h>
#endif
#else /*__APPLE__*/
@ -226,9 +239,6 @@ extern "C" {
#if defined(GLFW_INCLUDE_GLEXT)
#include <GL/glext.h>
#endif
#if defined(GLFW_INCLUDE_GLU)
#include <GL/glu.h>
#endif
#endif /*__APPLE__*/
@ -975,9 +985,9 @@ extern "C" {
* and [attribute](@ref GLFW_OPENGL_FORWARD_COMPAT_attrib).
*/
#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).
*/
#define GLFW_OPENGL_DEBUG_CONTEXT 0x00022007

View File

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

View File

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

View File

@ -645,11 +645,35 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg,
case WM_CHAR:
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:
{
const GLFWbool plain = (uMsg != WM_SYSCHAR);
if (uMsg == WM_UNICHAR && wParam == UNICODE_NOCHAR)
if (wParam == UNICODE_NOCHAR)
{
// WM_UNICHAR is not sent by Windows, but is sent by some
// third-party input method engine
@ -657,7 +681,7 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg,
return TRUE;
}
_glfwInputChar(window, (unsigned int) wParam, getKeyMods(), plain);
_glfwInputChar(window, (unsigned int) wParam, getKeyMods(), GLFW_TRUE);
return 0;
}

View File

@ -870,11 +870,18 @@ static void handleEvents(int timeout)
if (read_ret != 8)
return;
if (_glfw.wl.keyboardFocus)
{
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);
}
}
}
if (fds[2].revents & POLLIN)
{

View File

@ -164,7 +164,7 @@ void _glfwPollMonitorsX11(void)
if (widthMM <= 0 || heightMM <= 0)
{
// 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
// info and output info members
widthMM = (int) (ci->width * 25.4f / 96.f);