Compare commits

...

7 Commits

Author SHA1 Message Date
archbirdplus
564d87ca28
Merge a5b8e33eb3 into 7ef6efeb66 2025-08-19 11:14:10 +08: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
Archbirdplus
a5b8e33eb3 Updated changelog 2024-05-13 11:43:31 -07:00
Archbirdplus
00558659d6 Updated contributors 2024-05-13 11:42:39 -07:00
Archbirdplus
9cfa9552a5 X11: load dylibs when building for APPLE 2024-05-12 16:50:08 -07:00
7 changed files with 58 additions and 12 deletions

View File

@ -269,6 +269,7 @@ video tutorials.
- Samuli Tuomola
- Matthew Turner
- urraka
- Mark Valkin
- Elias Vanderstuyft
- Stef Velzel
- Jari Vetoniemi

View File

@ -139,11 +139,17 @@ information on what to include when reporting a bug.
fallback decorations
- [Wayland] Bugfix: Fallback decorations would report scroll events
- [Wayland] Bugfix: Keyboard repeat events halted when any key is released (#2568)
- [Wayland] Bugfix: Fallback decorations would show menu at wrong position
- [Wayland] Bugfix: The cursor was not updated when clicking through from
a modal to a fallback decoration
- [Wayland] Bugfix: The cursor position was not updated when clicking through
from a modal to the content area
- [X11] Bugfix: Running without a WM could trigger an assert (#2593,#2601,#2631)
- [Null] Added Vulkan 'window' surface creation via `VK_EXT_headless_surface`
- [Null] Added EGL context creation on Mesa via `EGL_MESA_platform_surfaceless`
- [EGL] Allowed native access on Wayland with `GLFW_CONTEXT_CREATION_API` set to
`GLFW_NATIVE_CONTEXT_API` (#2518)
- [X11] Added appropriate dynamic library names for MacOS
## Contact

View File

@ -372,7 +372,7 @@ GLFWbool _glfwInitEGL(void)
#elif defined(_GLFW_WIN32)
"libEGL.dll",
"EGL.dll",
#elif defined(_GLFW_COCOA)
#elif defined(__APPLE__)
"libEGL.dylib",
#elif defined(__CYGWIN__)
"libEGL-1.so",
@ -771,7 +771,7 @@ GLFWbool _glfwCreateContextEGL(_GLFWwindow* window,
#elif defined(_GLFW_WIN32)
"GLESv1_CM.dll",
"libGLES_CM.dll",
#elif defined(_GLFW_COCOA)
#elif defined(__APPLE__)
"libGLESv1_CM.dylib",
#elif defined(__OpenBSD__) || defined(__NetBSD__)
"libGLESv1_CM.so",
@ -788,7 +788,7 @@ GLFWbool _glfwCreateContextEGL(_GLFWwindow* window,
#elif defined(_GLFW_WIN32)
"GLESv2.dll",
"libGLESv2.dll",
#elif defined(_GLFW_COCOA)
#elif defined(__APPLE__)
"libGLESv2.dylib",
#elif defined(__CYGWIN__)
"libGLESv2-2.so",
@ -804,7 +804,8 @@ GLFWbool _glfwCreateContextEGL(_GLFWwindow* window,
#if defined(_GLFW_OPENGL_LIBRARY)
_GLFW_OPENGL_LIBRARY,
#elif defined(_GLFW_WIN32)
#elif defined(_GLFW_COCOA)
#elif defined(__APPLE__)
"libGL.1.dylib",
#elif defined(__OpenBSD__) || defined(__NetBSD__)
"libGL.so",
#else

View File

@ -263,6 +263,8 @@ GLFWbool _glfwInitGLX(void)
_GLFW_GLX_LIBRARY,
#elif defined(__CYGWIN__)
"libGL-1.so",
#elif defined(__APPLE__)
"libGL.1.dylib",
#elif defined(__OpenBSD__) || defined(__NetBSD__)
"libGL.so",
#else

View File

@ -57,10 +57,12 @@ GLFWbool _glfwInitVulkan(int mode)
_glfw.vk.handle = _glfwPlatformLoadModule(_GLFW_VULKAN_LIBRARY);
#elif defined(_GLFW_WIN32)
_glfw.vk.handle = _glfwPlatformLoadModule("vulkan-1.dll");
#elif defined(_GLFW_COCOA)
#elif defined(__APPLE__)
_glfw.vk.handle = _glfwPlatformLoadModule("libvulkan.1.dylib");
#if defined(_GLFW_COCOA)
if (!_glfw.vk.handle)
_glfw.vk.handle = _glfwLoadLocalVulkanLoaderCocoa();
#endif
#elif defined(__OpenBSD__) || defined(__NetBSD__)
_glfw.vk.handle = _glfwPlatformLoadModule("libvulkan.so");
#else

View File

@ -405,13 +405,19 @@ static void handleFallbackDecorationButton(_GLFWwindow* window,
}
else if (button == BTN_RIGHT)
{
if (window->wl.xdg.toplevel)
{
if (!window->wl.xdg.toplevel)
return;
if (window->wl.fallback.focus != window->wl.fallback.top.surface)
return;
if (ypos < GLFW_BORDER_SIZE)
return;
xdg_toplevel_show_window_menu(window->wl.xdg.toplevel,
_glfw.wl.seat, serial,
window->wl.cursorPosX,
window->wl.cursorPosY);
}
xpos,
ypos - GLFW_CAPTION_HEIGHT - GLFW_BORDER_SIZE);
}
}
@ -1532,11 +1538,21 @@ static void pointerHandleEnter(void* userData,
window->wl.hovered = GLFW_TRUE;
_glfwSetCursorWayland(window, window->wl.currentCursor);
_glfwInputCursorEnter(window, GLFW_TRUE);
if (window->cursorMode != GLFW_CURSOR_DISABLED)
{
window->wl.cursorPosX = wl_fixed_to_double(sx);
window->wl.cursorPosY = wl_fixed_to_double(sy);
_glfwInputCursorPos(window, window->wl.cursorPosX, window->wl.cursorPosY);
}
}
else
{
if (window->wl.fallback.decorations)
{
window->wl.fallback.focus = surface;
updateFallbackDecorationCursor(window, sx, sy);
}
}
}

View File

@ -607,6 +607,8 @@ static GLFWbool initExtensions(void)
{
#if defined(__OpenBSD__) || defined(__NetBSD__)
_glfw.x11.vidmode.handle = _glfwPlatformLoadModule("libXxf86vm.so");
#elif defined(__APPLE__)
_glfw.x11.vidmode.handle = _glfwPlatformLoadModule("libXxf86vm.1.dylib");
#else
_glfw.x11.vidmode.handle = _glfwPlatformLoadModule("libXxf86vm.so.1");
#endif
@ -631,6 +633,8 @@ static GLFWbool initExtensions(void)
_glfw.x11.xi.handle = _glfwPlatformLoadModule("libXi-6.so");
#elif defined(__OpenBSD__) || defined(__NetBSD__)
_glfw.x11.xi.handle = _glfwPlatformLoadModule("libXi.so");
#elif defined(__APPLE__)
_glfw.x11.xi.handle = _glfwPlatformLoadModule("libXi.6.dylib");
#else
_glfw.x11.xi.handle = _glfwPlatformLoadModule("libXi.so.6");
#endif
@ -663,6 +667,8 @@ static GLFWbool initExtensions(void)
_glfw.x11.randr.handle = _glfwPlatformLoadModule("libXrandr-2.so");
#elif defined(__OpenBSD__) || defined(__NetBSD__)
_glfw.x11.randr.handle = _glfwPlatformLoadModule("libXrandr.so");
#elif defined(__APPLE__)
_glfw.x11.randr.handle = _glfwPlatformLoadModule("libXrandr.2.dylib");
#else
_glfw.x11.randr.handle = _glfwPlatformLoadModule("libXrandr.so.2");
#endif
@ -757,6 +763,8 @@ static GLFWbool initExtensions(void)
_glfw.x11.xcursor.handle = _glfwPlatformLoadModule("libXcursor-1.so");
#elif defined(__OpenBSD__) || defined(__NetBSD__)
_glfw.x11.xcursor.handle = _glfwPlatformLoadModule("libXcursor.so");
#elif defined(__APPLE__)
_glfw.x11.xcursor.handle = _glfwPlatformLoadModule("libXcursor.1.dylib");
#else
_glfw.x11.xcursor.handle = _glfwPlatformLoadModule("libXcursor.so.1");
#endif
@ -780,6 +788,8 @@ static GLFWbool initExtensions(void)
_glfw.x11.xinerama.handle = _glfwPlatformLoadModule("libXinerama-1.so");
#elif defined(__OpenBSD__) || defined(__NetBSD__)
_glfw.x11.xinerama.handle = _glfwPlatformLoadModule("libXinerama.so");
#elif defined(__APPLE__)
_glfw.x11.xinerama.handle = _glfwPlatformLoadModule("libXinerama.1.dylib");
#else
_glfw.x11.xinerama.handle = _glfwPlatformLoadModule("libXinerama.so.1");
#endif
@ -835,6 +845,8 @@ static GLFWbool initExtensions(void)
_glfw.x11.x11xcb.handle = _glfwPlatformLoadModule("libX11-xcb-1.so");
#elif defined(__OpenBSD__) || defined(__NetBSD__)
_glfw.x11.x11xcb.handle = _glfwPlatformLoadModule("libX11-xcb.so");
#elif defined(__APPLE__)
_glfw.x11.x11xcb.handle = _glfwPlatformLoadModule("libX11-xcb.1.dylib");
#else
_glfw.x11.x11xcb.handle = _glfwPlatformLoadModule("libX11-xcb.so.1");
#endif
@ -850,6 +862,8 @@ static GLFWbool initExtensions(void)
_glfw.x11.xrender.handle = _glfwPlatformLoadModule("libXrender-1.so");
#elif defined(__OpenBSD__) || defined(__NetBSD__)
_glfw.x11.xrender.handle = _glfwPlatformLoadModule("libXrender.so");
#elif defined(__APPLE__)
_glfw.x11.xrender.handle = _glfwPlatformLoadModule("libXrender.1.dylib");
#else
_glfw.x11.xrender.handle = _glfwPlatformLoadModule("libXrender.so.1");
#endif
@ -879,6 +893,8 @@ static GLFWbool initExtensions(void)
_glfw.x11.xshape.handle = _glfwPlatformLoadModule("libXext-6.so");
#elif defined(__OpenBSD__) || defined(__NetBSD__)
_glfw.x11.xshape.handle = _glfwPlatformLoadModule("libXext.so");
#elif defined(__APPLE__)
_glfw.x11.xshape.handle = _glfwPlatformLoadModule("libXext.6.dylib");
#else
_glfw.x11.xshape.handle = _glfwPlatformLoadModule("libXext.so.6");
#endif
@ -1260,6 +1276,8 @@ GLFWbool _glfwConnectX11(int platformID, _GLFWplatform* platform)
void* module = _glfwPlatformLoadModule("libX11-6.so");
#elif defined(__OpenBSD__) || defined(__NetBSD__)
void* module = _glfwPlatformLoadModule("libX11.so");
#elif defined(__APPLE__)
void* module = _glfwPlatformLoadModule("libX11.6.dylib");
#else
void* module = _glfwPlatformLoadModule("libX11.so.6");
#endif