The primary purpose of this patch is to support Prism Launcher. Prism Launcher allows for using an alternate GLFW library and does so by launching Minecraft with the `-Dorg.lwjgl.glfw.libname=path/to/library` argument. However LWJGL3 does not have a command line argument to set the window appId which means that currently all Prism Launcher-managed Minecraft instances have a blank appId and are thus not correctly associated with Prism Launcher in Window Managers.
Unfortunately because Minecraft players frequently play old versions of Minecraft it's not really a valid solution to add such a command line argument to LWJGL3 as it would only fix future versions of Minecraft. Instead we can add an environmental variable fallback which is read only if the appId variable is not set. By doing so Prism Launcher can set this environmental variable for launched Minecraft instances and we can fix all existing versions of Minecraft and all existing modpacks (well, all versions of Minecraft with a version of LWJGL that works with the system GLFW library).
The glfwCreateWindow function ensures that the width and height are
at least greater or equal than zero, but on X11 it is invalid to
create a window with dimensions that equal zero, see [1].
This change ensures that the dimensions passed to XCreateWindow are
at least 1 by 1.
This issue was detected in [2], where a call to glfwCreateWindow
was done to request a 1x1 window, with a _glfw.x11.contentScaleX of
less than 1.0 (0.958333) this results in a request for a 0x0 window
which then causes an BadWindow error from X11.
[1]: e003f52661/specs/libX11/CH03.xml (L1333-1337)
[2]: https://github.com/WerWolv/ImHex/pull/2390
This adds the glfwGetGLXFBConfig function for querying the GLXFBConfig
the GLXWindow of a window.
This commit is a squashed and modified version of PR #1925 by knokko.
The following changes were made by elmindreda:
The function signature was changed to handle GLXFBConfig being an opaque
value in core GLX. The function error checks were fixed and updated.
The struct member name was changed. The struct member clearing on
context destruction was removed. All documentation snippets were
updated.
Closes#1925
This adds the glfwGetEGLConfig function for querying the EGLConfig of
the EGLSurface of a window.
This is a re-implementation of the PR #2045 by knokko, slightly
redesigned to handle EGLConfig being an opaque type in core EGL.
Closes#2045
If a modal surface like the window menu was active, clicking on the GLFW
window content area to close it would correctly emit the cursor enter
event but would not propagate the cursor position from the event.
When a click through to the fallback decorations caused the end of
a modal like the window menu, the cursor shape would not be updated
until the next time the cursor moved.
This commit adds an update of the cursor for the pointer enter event for
fallback decoration surfaces, in addition to the updates at pointer
motion events.
The fallback decorations would place the menu at the wrong position, by
not translating the last decoration surface position into toplevel
surface coordinates.
This also limits the menu to the caption area of the top decoration
surface, similar to how other toolkits work.
If fallback decorations were in use, pointer motion over a decoration
surface would cause glfwGetCursorPos to provide incorrect cursor
positions.
The cursor position is now only updated when the pointer is over the
content area of the window, similar to libdecor and XDG decorations.
Windows with keyboard focus may have an active key repeat timer.
This should be reset when the window is closed, or key repeat events
could be sent to a NULL window were it not for the quickfix in PR #2732.
Fixes#2741
Probably the source of #2727
It's increasingly difficult to maintain a safe testing environment for
Windows XP, and so increasingly a burden on contributors to maintain
support for it.
Windows XP has been out of of support since 2014 and should not be used
as a desktop OS.
Fixes#2505
The original MinGW distribution appears to no longer be maintained and
should not be used. Anyone still using MinGW should consider switching
to the MinGW-w64 fork or another actively maintained toolchain.
MinGW-w64 supports 64-bit binaries and provides much newer compilers and
Win32 headers.
Fixes#2540
If detectEWMH failed to query the EWMH helper window, it would return
without restoring the previous Xlib error handler. This was bad
(because other code might also be using the facility) and bad (because
GLFW would assert the next time it tried to grab the error handler).
This commit adds the necessary release call.
Closes#2593Fixes#2601Closes#2631
libxkbcommon already provides functions to convert keysyms to codepoints
and UTF-8. The library has offered these functions since 0.5.0[1], so
using them won't cause any compatibility problems.
[1] https://xkbcommon.org/doc/0.5.0/group__keysyms.htmlCloses#2444
This replaces some workarounds and manual logic with new features
available with CMake 3.16, including list(FILTER), list(JOIN),
foreach(IN LISTS) and enable_language(OBJC). Policy settings no longer
needed with 3.16 have been removed.
Related to #2541