mirror of
https://github.com/glfw/glfw.git
synced 2025-12-21 14:42:06 +00:00
Compare commits
5 Commits
7ab80da444
...
3da7391f4c
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3da7391f4c | ||
|
|
7ef6efeb66 | ||
|
|
3cf9f6726d | ||
|
|
bfa1c424e5 | ||
|
|
6d94c6792b |
@ -139,6 +139,11 @@ information on what to include when reporting a bug.
|
|||||||
fallback decorations
|
fallback decorations
|
||||||
- [Wayland] Bugfix: Fallback decorations would report scroll events
|
- [Wayland] Bugfix: Fallback decorations would report scroll events
|
||||||
- [Wayland] Bugfix: Keyboard repeat events halted when any key is released (#2568)
|
- [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)
|
- [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 Vulkan 'window' surface creation via `VK_EXT_headless_surface`
|
||||||
- [Null] Added EGL context creation on Mesa via `EGL_MESA_platform_surfaceless`
|
- [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)
|
else if (button == BTN_RIGHT)
|
||||||
{
|
{
|
||||||
if (window->wl.xdg.toplevel)
|
if (!window->wl.xdg.toplevel)
|
||||||
{
|
return;
|
||||||
xdg_toplevel_show_window_menu(window->wl.xdg.toplevel,
|
|
||||||
_glfw.wl.seat, serial,
|
if (window->wl.fallback.focus != window->wl.fallback.top.surface)
|
||||||
window->wl.cursorPosX,
|
return;
|
||||||
window->wl.cursorPosY);
|
|
||||||
}
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1010,48 +1016,57 @@ static GLFWbool createLibdecorFrame(_GLFWwindow* window)
|
|||||||
|
|
||||||
static void updateXdgSizeLimits(_GLFWwindow* window)
|
static void updateXdgSizeLimits(_GLFWwindow* window)
|
||||||
{
|
{
|
||||||
int minwidth, minheight, maxwidth, maxheight;
|
int minwidth = 0, minheight = 0;
|
||||||
|
int maxwidth = 0, maxheight = 0;
|
||||||
|
GLFWbool setMin = GLFW_FALSE, setMax = GLFW_FALSE;
|
||||||
|
|
||||||
if (window->resizable)
|
if (window->resizable)
|
||||||
{
|
{
|
||||||
if (window->minwidth == GLFW_DONT_CARE || window->minheight == GLFW_DONT_CARE)
|
if (window->minwidth != GLFW_DONT_CARE && window->minheight != GLFW_DONT_CARE)
|
||||||
minwidth = minheight = 0;
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
minwidth = window->minwidth;
|
minwidth = window->minwidth;
|
||||||
minheight = window->minheight;
|
minheight = window->minheight;
|
||||||
|
setMin = GLFW_TRUE;
|
||||||
if (window->wl.fallback.decorations)
|
|
||||||
{
|
|
||||||
minwidth += GLFW_BORDER_SIZE * 2;
|
|
||||||
minheight += GLFW_CAPTION_HEIGHT + GLFW_BORDER_SIZE;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (window->maxwidth == GLFW_DONT_CARE || window->maxheight == GLFW_DONT_CARE)
|
if (window->maxwidth != GLFW_DONT_CARE && window->maxheight != GLFW_DONT_CARE)
|
||||||
maxwidth = maxheight = 0;
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
maxwidth = window->maxwidth;
|
maxwidth = window->maxwidth;
|
||||||
maxheight = window->maxheight;
|
maxheight = window->maxheight;
|
||||||
|
setMax = GLFW_TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
if (window->wl.fallback.decorations)
|
if (window->wl.fallback.decorations)
|
||||||
|
{
|
||||||
|
if (setMin)
|
||||||
{
|
{
|
||||||
maxwidth += GLFW_BORDER_SIZE * 2;
|
minwidth += GLFW_BORDER_SIZE * 2;
|
||||||
|
minheight += GLFW_CAPTION_HEIGHT + GLFW_BORDER_SIZE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (setMax)
|
||||||
|
{
|
||||||
|
maxwidth += GLFW_BORDER_SIZE * 2;
|
||||||
maxheight += GLFW_CAPTION_HEIGHT + GLFW_BORDER_SIZE;
|
maxheight += GLFW_CAPTION_HEIGHT + GLFW_BORDER_SIZE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
// Non-resizable: lock to current size
|
||||||
minwidth = maxwidth = window->wl.width;
|
minwidth = maxwidth = window->wl.width;
|
||||||
minheight = maxheight = window->wl.height;
|
minheight = maxheight = window->wl.height;
|
||||||
|
setMin = setMax = GLFW_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
xdg_toplevel_set_min_size(window->wl.xdg.toplevel, minwidth, minheight);
|
if (setMin)
|
||||||
xdg_toplevel_set_max_size(window->wl.xdg.toplevel, maxwidth, maxheight);
|
xdg_toplevel_set_min_size(window->wl.xdg.toplevel, minwidth, minheight);
|
||||||
|
|
||||||
|
if (setMax)
|
||||||
|
xdg_toplevel_set_max_size(window->wl.xdg.toplevel, maxwidth, maxheight);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static GLFWbool createXdgShellObjects(_GLFWwindow* window)
|
static GLFWbool createXdgShellObjects(_GLFWwindow* window)
|
||||||
{
|
{
|
||||||
window->wl.xdg.surface = xdg_wm_base_get_xdg_surface(_glfw.wl.wmBase,
|
window->wl.xdg.surface = xdg_wm_base_get_xdg_surface(_glfw.wl.wmBase,
|
||||||
@ -1532,11 +1547,21 @@ static void pointerHandleEnter(void* userData,
|
|||||||
window->wl.hovered = GLFW_TRUE;
|
window->wl.hovered = GLFW_TRUE;
|
||||||
_glfwSetCursorWayland(window, window->wl.currentCursor);
|
_glfwSetCursorWayland(window, window->wl.currentCursor);
|
||||||
_glfwInputCursorEnter(window, GLFW_TRUE);
|
_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
|
else
|
||||||
{
|
{
|
||||||
if (window->wl.fallback.decorations)
|
if (window->wl.fallback.decorations)
|
||||||
|
{
|
||||||
window->wl.fallback.focus = surface;
|
window->wl.fallback.focus = surface;
|
||||||
|
updateFallbackDecorationCursor(window, sx, sy);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user