mirror of
https://github.com/glfw/glfw.git
synced 2025-08-21 14:12:13 +00:00
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.
This commit is contained in:
parent
0d2d85d19c
commit
bfa1c424e5
@ -139,6 +139,7 @@ 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
|
||||
- [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`
|
||||
|
@ -405,13 +405,19 @@ static void handleFallbackDecorationButton(_GLFWwindow* window,
|
||||
}
|
||||
else if (button == BTN_RIGHT)
|
||||
{
|
||||
if (window->wl.xdg.toplevel)
|
||||
{
|
||||
xdg_toplevel_show_window_menu(window->wl.xdg.toplevel,
|
||||
_glfw.wl.seat, serial,
|
||||
window->wl.cursorPosX,
|
||||
window->wl.cursorPosY);
|
||||
}
|
||||
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,
|
||||
xpos,
|
||||
ypos - GLFW_CAPTION_HEIGHT - GLFW_BORDER_SIZE);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user