Commit Graph

4879 Commits

Author SHA1 Message Date
Sebastian Dawid
55688f4ff4
Merge fb0828d828 into 162896e5b9 2025-11-14 18:35:51 +01:00
Doug Binks
162896e5b9
Wayland: free modules at end of terminate function
- Fixes #2744
2025-11-14 16:35:47 +00:00
Sebastian Emanuel Dawid
fb0828d828 Add option to enable building the WebGPU example
The example is now not built by default. Move code to fetch pre-compiled
`wgpu_native` library to `CMake/modules/FindWebGPU.cmake`.
2025-11-14 15:18:14 +01:00
Sebastian Emanuel Dawid
0e80ca651b Create universal WebGPU library during project configuration on macOS 2025-11-13 10:40:00 +01:00
Sebastian Emanuel Dawid
4e1fbfbf92 Fix IMPLIB naming for MinGW 2025-11-12 16:35:38 +01:00
Sebastian Emanuel Dawid
db5fc21072 Switch back to linking against shared library version of wgpu_native 2025-11-12 16:31:08 +01:00
Sebastian Emanuel Dawid
c8c7405f37 Fix typo in URL for secondary wgpu_native ARCH on macOS 2025-11-12 15:45:51 +01:00
Sebastian Emanuel Dawid
15693a1bde Inline code to fetch prebuilt wgpu_native static library 2025-11-12 15:43:49 +01:00
Doug Binks
936307558e X11: Clamp w,h in glfwSetWindowSize to >= 1
-  prevents BadValue error and program exit
2025-11-08 10:37:52 +00:00
Drew Weymouth
4df5129529 X11: check crtcInfo for NULL when polling monitors 2025-11-07 17:39:26 +00:00
Ivor Wanders
6de70d8252 X11: Prevent BadWindow when creating small windows
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
2025-11-07 17:24:35 +00:00
Sebastian Emanuel Dawid
3fe235fb56 Remove unnecessary CMake message printing the CMAKE_SYSTEM_PROCESSOR variable 2025-10-29 11:01:41 +01:00
Sebastian Emanuel Dawid
95e1dcce2e Add metal layer creation that was previously missing. 2025-10-01 09:06:03 +02:00
Sebastian Dawid
0111a5977e Implement rendering a red triangle in the triangle-webgpu example 2025-09-30 11:42:16 +02:00
Sebastian Emanuel Dawid
1471e07ceb Partially Revert "Remove function to pass address of wgpuInstanceCreateSurface."
This reverts commit 8c2f255906.
2025-09-29 15:30:00 +02:00
Sebastian Emanuel Dawid
044774dcee Provide weak default implementation for wgpuInstanceCreateSurface 2025-09-29 14:40:31 +02:00
Sebastian Emanuel Dawid
b0b39d678e Remove now unused wgpu member of _glfw 2025-09-29 11:41:35 +02:00
Sebastian Emanuel Dawid
8c2f255906 Remove function to pass address of wgpuInstanceCreateSurface.
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.
2025-09-29 11:35:26 +02:00
Sebastian Dawid
a80acffdba
Merge branch 'glfw:master' into webgpu 2025-09-29 09:59:30 +02:00
knokko
8e15281d34 Add glfwGetGLXFBConfig native access function
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
2025-09-01 16:05:26 +02:00
Camilla Löwy
621e99d53e Add glfwGetEGLConfig native access function
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
2025-09-01 16:05:24 +02:00
Camilla Löwy
1a0b7827d4 EGL: Fix error return value for glfwGetEGLSurface
This is a semantic fix only.  The behavior is unchanged.
2025-08-29 19:27:21 +02:00
Camilla Löwy
4c64184455 Remove title member from window config
The window title is already available in the window struct.
2025-08-29 19:27:21 +02:00
Camilla Löwy
bfcb98fb6c Replace some Doxygen aliases with Markdown 2025-08-29 19:27:21 +02:00
Camilla Löwy
f8582d26d0 Add Markdown files as sources to IDE docs target 2025-08-29 19:27:21 +02:00
Camilla Löwy
1fdd39cf3e Fix documentation target dependency
Related to #2704
2025-08-29 19:27:08 +02:00
Camilla Löwy
c9b129753a Update Doxygen version handling 2025-08-28 19:05:42 +02:00
Camilla Löwy
04a67c8267 Fix X11 clipboard compatibility description 2025-08-28 19:04:47 +02:00
Camilla Löwy
5c87937e44 Update README 2025-08-28 18:56:20 +02:00
Sebastian Emanuel Dawid
54fcbc8220 Adjust formatting of new code to fit in with the rest of the code 2025-08-27 00:46:35 +02:00
Camilla Löwy
63a7e8b7f8 Add and update Wayland-specific notes in docs
Fixes #2746
2025-08-20 20:13:07 +02:00
Doug Binks
acb92944d4 Revert readme for "Wayland: Keyboard leave event handler now processes key repeats" 2025-08-19 11:30:52 +02:00
Camilla Löwy
7ef6efeb66 Wayland: Fix cursor position after a modal
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.
2025-08-18 20:58:12 +02:00
Camilla Löwy
3cf9f6726d Wayland: Fix fallback decoration cursor updating
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.
2025-08-18 18:06:46 +02:00
Camilla Löwy
bfa1c424e5 Wayland: Fix fallback decoration menu placement
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.
2025-08-18 18:06:46 +02:00
Sebastian Emanuel Dawid
44f8a80ade Add WebGPU support for MacOS 2025-08-16 00:46:54 +02:00
Sebastian Dawid
4cbb4db70c Add WebGPU support for Windows 2025-08-16 00:30:16 +02:00
Sebastian Emanuel Dawid
205bf6c768 Add WebGPU support to X11 2025-08-15 23:57:40 +02:00
Sebastian Emanuel Dawid
37812b7e36 Revert "Try loading surface creation function via dlsym instead"
This reverts commit cb0c28908f.
2025-08-15 23:39:30 +02:00
Sebastian Emanuel Dawid
cb0c28908f Try loading surface creation function via dlsym instead 2025-08-15 23:38:04 +02:00
Sebastian Emanuel Dawid
8dc6a1f00b Add surface creation function to wl platform initialization 2025-08-15 23:12:47 +02:00
Sebastian Emanuel Dawid
2f44430536 Added native support for creating WebGPU surfaces
Note that this commit only adds support when running on Wayland.
2025-08-15 23:08:51 +02:00
Doug Binks
0d2d85d19c Revert "Wayland: Keyboard leave event handler now processes key repeats" 2025-08-15 11:27:59 +02:00
Jan Hendrik Farr
768e81a0eb Wayland: Fix key repeat halting
Key repeat shoud only be halted when the repeating key
is released, not when another key is released.
2025-08-14 15:35:04 +02:00
Camilla Löwy
161fb1b6f6 Wayland: Fix fallback decoration scroll events
The fallback decorations would emit scroll events as if scrolling had
occurred over the content area of the window.
2025-08-12 17:11:27 +02:00
Camilla Löwy
645a35a38e Wayland: Cleanup 2025-08-12 17:11:27 +02:00
Camilla Löwy
7523b0e6bd Wayland: Move fallback decoration pointer logic
Decluttered the wl_pointer handlers by moving the bulk of fallback
decoration related logic to separate functions.
2025-08-12 17:11:26 +02:00
Camilla Löwy
5190a30d8a Wayland: Move fallback decoration struct member
The cursorPreviousName member was only used for the fallback decorations
but was not grouped with other related members.
2025-08-12 17:11:26 +02:00
Camilla Löwy
ddbb8e0f2c Wayland: Fix fallback decoration cursor position
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.
2025-08-12 17:11:24 +02:00
Camilla Löwy
5245180c56 Formatting 2025-08-12 17:10:43 +02:00