Commit Graph

4148 Commits

Author SHA1 Message Date
Camilla Löwy
782e6b6cef Make joystick platform code init on demand
This makes joystick support initialize the first time a joystick
function is called, including those gamepad functions that are layered
on top of joystick functions.

Related to #1284.
Related to #1646.
2020-07-21 17:38:56 +02:00
Camilla Löwy
f760b124ca Wayland: Fix scroll offsets being inverted
Scrolling offsets were inverted compared to X11 and Win32.

Fixes #1463.
2020-07-15 23:16:01 +02:00
Camilla Löwy
5f60c22cfa Wayland: Fix partial framebuffer size retrieval 2020-07-15 21:56:52 +02:00
Camilla Löwy
5c92cd9f52 Make windows test a tolerable example 2020-07-15 19:22:30 +02:00
Camilla Löwy
686e18fd72 Remove window opacity test
It has been superceded by the window property test.
2020-07-15 19:08:09 +02:00
Camilla Löwy
3207fc7120 Add window property test 2020-07-15 19:08:04 +02:00
Camilla Löwy
74b9f309a9 Update Nuklear to 4.01.3 2020-07-15 18:02:38 +02:00
Camilla Löwy
a122d91303 Documentation work for GLFW_MOUSE_PASSTHROUGH
Related to #1568.
2020-07-15 18:02:38 +02:00
Camilla Löwy
dfeacee000 Move mouse passthrough before window showing
Related to #1568.
2020-07-15 18:02:38 +02:00
Camilla Löwy
1095a43708 Remove no-op call at window creation
Related to #1568.
2020-07-15 18:02:38 +02:00
Camilla Löwy
6d2003d07a Move management of shared state to shared code
Platform code may not modify shared state.

Related to #1568.
2020-07-15 18:02:38 +02:00
Camilla Löwy
7da3e52c86 Win32: Fix GLFW_MOUSE_PASSTHROUGH dropping events
Returning HTTRANSPARENT from WM_NCHITTEST does cause the window to be
transparent for some hit-testing APIs but does not make it pass mouse
input through to whatever window is below it.

For that to work on modern Windows, the window needs to be both layered
and extended-window-style-transparent.

Additional logic changes to ensure mouse input passthrough, framebuffer
transparency and window opacity are mindful of one another when
modifying WS_EX_LAYERED.

Related to #1568.
2020-07-15 18:00:43 +02:00
Camilla Löwy
68e4261d73 X11: Include X Shape extension headers
Related to #1568.
2020-07-15 18:00:00 +02:00
Camilla Löwy
e81d381256 X11: Fix disabling of GLFW_MOUSE_PASSTHROUGH
The client clip region was left in place when mouse passthrough was
disabled, leading to missing mouse input if the window grew beyond it.

Related to #1568.
2020-07-15 18:00:00 +02:00
Rokas Kupstys
d285a9fdeb Add support for mouse input transparency
This adds the GLFW_MOUSE_PASSTHROUGH window hint and attribute for
controlling whether mouse input passes through the window to whatever
window is behind it.

Fixes #1236.
Closes #1568.
2020-07-15 17:59:55 +02:00
Camilla Löwy
6c031af245 Null: Fix typos in workarea retrieval 2020-07-13 19:43:13 +02:00
Camilla Löwy
49dbcfcb8c X11: Fix cursor hover query retry behavior
XQueryPointer returns zero on BadWindow so the retry did not happen.

Related to ceb20c7f97.
2020-07-10 00:05:09 +02:00
Camilla Löwy
ceb20c7f97 X11: Fix race in window hovered query
The window decoration window can go away between calls to XQueryPointer,
for example if the GLFW_DECORATED window attribute was just cleared.
2020-07-09 22:36:59 +02:00
Camilla Löwy
4ae93e0547 X11: Remove non-UTF-8 fallback paths
It seems it has not been possible to compile GLFW on systems without the
UTF-8 extensions to Xlib since a0a5cc57df
was merged five months ago.  The UTF-8 extension functions were
introduced with XFree86 4.0.2 in December 2000 and are likely widely
available at this point.

This removes the locale-dependent fallback paths and uses the UTF-8
extension functions where available.
2020-07-02 21:38:40 +02:00
Camilla Löwy
9a3664b4a9 X11: Fix detection of key events duplicated by XIM
Background: The IM will filter out key events, instead sending exact
duplicate events that are not filtered.  It does not send these for
every event, however, so the duplicate events cannot be relied on for
key input.  Instead we need to identify and discard them.  Since they
are identical, they have the same timestamp as the originals.

The previous duplicate event detection would consume unrelated key
events if the keys were pressed simultaneously, as it only tracked
a single timestamp.

This fixes that issue for any combination of keys, at the expense of
a 1 KB array per GLFW window.

This fix is a stopgap until explicit IME support is done.

Based on #1472 by @LucaRood.

Fixes #1112.
Fixes #1415.
Fixes #1616.
Fixes #1663.
Closes #1472.
2020-07-02 21:38:03 +02:00
Camilla Löwy
6ce2070392 Win32: Fix non-BMP Unicode codepoint input
Supplementary Plane codepoints from WM_CHAR and WM_SYSCHAR messages were
reported as UTF-16 surrogate pairs.

Related to #1635.
2020-06-29 23:50:05 +02:00
Camilla Löwy
e47832ffcf Cocoa: Fix regression in private use area check
This fixes a regression introduced by
ad9eb768c9.
2020-06-29 23:23:26 +02:00
Camilla Löwy
ad9eb768c9 Cocoa: Fix non-BMP Unicode codepoint input
Supplimentary Plane codepoints were reported as UTF-16 surrogate pairs.

Fixes #1635.
2020-06-29 23:03:24 +02:00
Camilla Löwy
854ce1db4e Fix format of change log entry 2020-06-29 21:14:29 +02:00
Camilla Löwy
f5f060e6bf Init hint documentation work
The documentation for window hints had several features that had not
been carried over to init hints.

This also removes listing glfwInitHint for each hint, which was an
artifact of the removal of glfwInitHintString.
2020-06-29 00:02:41 +02:00
Camilla Löwy
0dea8a4441 EGL: Add support for EGL_ANGLE_platform_angle
This adds basic support for selecting the platform type (rendering
backend) when running on ANGLE.

Related to #1380.
2020-06-29 00:02:22 +02:00
Camilla Löwy
e6a6a99813 Use stdbool more consistently in glfwinfo 2020-06-28 21:23:29 +02:00
Camilla Löwy
1cecb8beb0 Move glfwinfo argument processing before glfwInit
This will allow init hints to be controlled by command-line arguments.
2020-06-28 21:23:29 +02:00
Camilla Löwy
36f8250321 Add missing entries to new symbols list
Related to #1692.
2020-06-28 19:27:49 +02:00
Camilla Löwy
b420ca7404 Add GLFW_CONTEXT_DEBUG window hint alias
This adds GLFW_CONTEXT_DEBUG as a preferred alias for
the GLFW_OPENGL_DEBUG_CONTEXT window hint, as debug contexts are
defined for both OpenGL and OpenGL ES.

Related to #1720.
2020-06-28 19:27:48 +02:00
Camilla Löwy
4e3b43383a Re-word docs for GLFW_OPENGL_DEBUG_CONTEXT attrib
Related to #1720.
2020-06-28 19:25:28 +02:00
A. Tombs
8a69a0d7e5 Re-word docs for OPENGL_DEBUG_CONTEXT hint
Re-worded documentation for the `GLFW_OPENGL_DEBUG_CONTEXT` window hint
to avoid implying that it only applies to OpenGL contexts. Added a link
to the relevant Khronos extension description.

Closes #1720.
2020-06-26 17:48:46 +02:00
Camilla Löwy
2539d03747 Win32: Use helper window DC as EGL native display
Closes #1717.
2020-06-24 00:51:19 +02:00
Camilla Löwy
bcb8558189 Remove EGL and OSMesa struct member macros
Now that the EGL and OSMesa structs can be used safely by any platform,
the member macros serve no purpose.
2020-06-24 00:50:49 +02:00
Camilla Löwy
aec9fae8f3 EGL: Add support for EGL_EXT_platform_base
This adds support for EGL_EXT_platform_base and its associated X11 and
Wayland extensions, allowing us to explicitly tell EGL which window
system we are using.

This is based on work by @linkmauve in #1691.

Closes #1691.
2020-06-24 00:49:55 +02:00
Camilla Löwy
d7f7b0e1b5 EGL: Replace native handle macros with functions
This change is in preparation both for EGL_EXT_platform_base and runtime
GLFW platform selection.

Related to #1691.
2020-06-24 00:48:53 +02:00
Luflosi
b66f105f3e
Fix typos 2020-06-23 16:41:37 +02:00
Camilla Löwy
bf1c62b261 Remove deprecated sudo key from Travis CI config 2020-06-17 20:21:50 +02:00
Camilla Löwy
3a3c32c6b1 Add credit
Related to #1712.
2020-06-17 20:21:50 +02:00
Tatsuya Yatagawa
81f475bccb Fix GLU header inclusion being disabled
This fixes a regression introduced by
105cf32e0b where GLFW_INCLUDE_GLU had no
effect if the GLFW header detected an earlier OpenGL header or loader
library header.

Closes #1712.
2020-06-17 18:31:44 +02:00
Camilla Löwy
c1f60ab5dc Make compiler specific workarounds more consistent 2020-06-08 01:07:35 +02:00
Camilla Löwy
e47705d8fb Move more compiler workarounds to library setup
These are details of the glfw CMake target and belong in the creation of
that target.
2020-06-08 01:07:34 +02:00
Camilla Löwy
8369880b56 Only look for OSMesa module if building examples
GLFW itself doesn't need the OSMesa headers to build.
2020-06-08 01:07:34 +02:00
Camilla Löwy
cfc23cd087 Fix MinGW linker flag tests breaking later tests 2020-06-08 01:07:34 +02:00
Camilla Löwy
69ff0b8ee0 Refresh Doxygen file with version 1.8.18 2020-06-05 19:11:04 +02:00
Camilla Löwy
e0c77f71f9 Null: Make platform more conformant
This makes the null platform behave more like an actual stub.  More
queryable state is tracked and there is even a fake monitor with one
whole fake video mode.
2020-06-02 22:40:09 +02:00
Camilla Löwy
c72da994ba Wayland: Fix repeated keys reported to NULL window
This fixes a race between the key repeat logic and the surface leave
event handler, which could result in repeated keys being reported with
a window of NULL.

Fixes #1704.
2020-06-02 19:54:30 +02:00
Camilla Löwy
399c2a1fad Clarify docs on default GL header inclusion
The documentation claims that any extension loader library header
included before the GLFW one will prevent the inclusion of the
default OpenGL header.  In reality this only worked if the loader
defined the canonical desktop OpenGL __gl_h_ inclusion guard and even
then relied on the OpenGL header to detect this.

This is the companion to 105cf32e0b, which
added the preprocessor logic to check for many known OpenGL and OpenGL
ES inclusion guards and not even attempt to include the default header
if any are present.

Some clarification of the language around header inclusion has also been
attempted, including making GLFW_INCLUDE_NONE more prominent.

Fixes #1695.
2020-06-02 18:04:49 +02:00
Camilla Löwy
9a87c2a4b4 Add feature available/implemented errors
This adds two new error codes: GLFW_FEATURE_UNAVAILABLE for when
a GLFW feature cannot be reasonably implemented on that platform, and
GLFW_FEATURE_UNIMPLEMENTED for when it can be but has not been yet.

This replaces the current situation where the Wayland code emitted
GLFW_PLATFORM_ERROR in both cases while the macOS code silently did
nothing.

If your application exits on any GLFW error, these error codes should at
least be easy to filter out from that behavior.

Ideally, GLFW_FEATURE_UNAVAILABLE should be rare and
GLFW_FEATURE_UNIMPLEMENTED should never be emitted at all.

Fixes #1692.
2020-06-02 17:18:18 +02:00
Camilla Löwy
fbf8aae44f Fix typo in header option macro docs 2020-05-31 15:28:57 +02:00