mirror of
https://github.com/glfw/glfw.git
synced 2024-11-22 13:04:35 +00:00
Wayland: Make function behavior match name
The logic that checks the decorated attribute belongs on the outside along with other related checks (fullscreen, monitor, decoration mode).
This commit is contained in:
parent
be7f4513c0
commit
c4fbe80d90
@ -220,7 +220,7 @@ static void createFallbackDecorations(_GLFWwindow* window)
|
|||||||
unsigned char data[] = { 224, 224, 224, 255 };
|
unsigned char data[] = { 224, 224, 224, 255 };
|
||||||
const GLFWimage image = { 1, 1, data };
|
const GLFWimage image = { 1, 1, data };
|
||||||
|
|
||||||
if (!_glfw.wl.viewporter || !window->decorated)
|
if (!_glfw.wl.viewporter)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!window->wl.decorations.buffer)
|
if (!window->wl.decorations.buffer)
|
||||||
@ -276,7 +276,10 @@ static void xdgDecorationHandleConfigure(void* userData,
|
|||||||
window->wl.xdg.decorationMode = mode;
|
window->wl.xdg.decorationMode = mode;
|
||||||
|
|
||||||
if (mode == ZXDG_TOPLEVEL_DECORATION_V1_MODE_CLIENT_SIDE)
|
if (mode == ZXDG_TOPLEVEL_DECORATION_V1_MODE_CLIENT_SIDE)
|
||||||
|
{
|
||||||
|
if (window->decorated)
|
||||||
createFallbackDecorations(window);
|
createFallbackDecorations(window);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
destroyFallbackDecorations(window);
|
destroyFallbackDecorations(window);
|
||||||
}
|
}
|
||||||
@ -446,8 +449,11 @@ static void releaseMonitor(_GLFWwindow* window)
|
|||||||
setIdleInhibitor(window, GLFW_FALSE);
|
setIdleInhibitor(window, GLFW_FALSE);
|
||||||
|
|
||||||
if (window->wl.xdg.decorationMode != ZXDG_TOPLEVEL_DECORATION_V1_MODE_SERVER_SIDE)
|
if (window->wl.xdg.decorationMode != ZXDG_TOPLEVEL_DECORATION_V1_MODE_SERVER_SIDE)
|
||||||
|
{
|
||||||
|
if (window->decorated)
|
||||||
createFallbackDecorations(window);
|
createFallbackDecorations(window);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void xdgToplevelHandleConfigure(void* userData,
|
static void xdgToplevelHandleConfigure(void* userData,
|
||||||
struct xdg_toplevel* toplevel,
|
struct xdg_toplevel* toplevel,
|
||||||
@ -647,8 +653,11 @@ static GLFWbool createShellObjects(_GLFWwindow* window)
|
|||||||
zxdg_toplevel_decoration_v1_set_mode(window->wl.xdg.decoration, mode);
|
zxdg_toplevel_decoration_v1_set_mode(window->wl.xdg.decoration, mode);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
if (window->decorated)
|
||||||
createFallbackDecorations(window);
|
createFallbackDecorations(window);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (window->minwidth != GLFW_DONT_CARE && window->minheight != GLFW_DONT_CARE)
|
if (window->minwidth != GLFW_DONT_CARE && window->minheight != GLFW_DONT_CARE)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user