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
I use an extern function with the `weak` attribute and an assert
to ensure that the function is available at runtime instead.
I also started to add an example using WebGPU.
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.