mirror of
https://github.com/glfw/glfw.git
synced 2026-09-19 15:25:50 +00:00
Wayland: Fix erratic fallback decoration behavior
The handler for xdg_toplevel::configure treated the provided size as the
content area size when instead it is the size of the bounding rectangle
of the wl_surface and all its subsurfaces.
This caused the fallback decorations to try positioning themselves
outside themselves, causing feedback loops during interactive resizing.
Fixes #1991
Fixes #2115
Closes #2127
Related to #1914
(cherry picked from commit 0f5b095042)
This commit is contained in:
+11
-2
@@ -538,8 +538,17 @@ static void xdgToplevelHandleConfigure(void* userData,
|
||||
|
||||
if (width && height)
|
||||
{
|
||||
window->wl.pending.width = width;
|
||||
window->wl.pending.height = height;
|
||||
if (window->wl.decorations.top.surface)
|
||||
{
|
||||
window->wl.pending.width = _glfw_max(0, width - GLFW_BORDER_SIZE * 2);
|
||||
window->wl.pending.height =
|
||||
_glfw_max(0, height - GLFW_BORDER_SIZE - GLFW_CAPTION_HEIGHT);
|
||||
}
|
||||
else
|
||||
{
|
||||
window->wl.pending.width = width;
|
||||
window->wl.pending.height = height;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user