mirror of
https://github.com/glfw/glfw.git
synced 2026-09-20 16:30:45 +00:00
Wayland: Add initial support for libdecor
This is partly based on the implementation of libdecor support in PR #1693 by @ christianrauch. Where available, the libdecor library is loaded at init and becomes the preferred method for window decorations. On compositors that support XDG decorations, libdecor in turn uses those. If not, libdecor has a plug-in archtecture and may load additional libraries to either use compositor-specific decorations or draw its own. If necessary, support for libdecor can be disabled with the GLFW_WAYLAND_LIBDECOR init hint. This is mostly in case some part of the dynamic loading or duplication of header material added here turns out to cause problems with future versions of libdecor-0.so.0. Fixes #1639 Closes #1693 Related to #1725
This commit is contained in:
@@ -62,6 +62,9 @@ static _GLFWinitconfig _glfwInitHints =
|
||||
{
|
||||
GLFW_TRUE, // X11 XCB Vulkan surface
|
||||
},
|
||||
{
|
||||
GLFW_WAYLAND_PREFER_LIBDECOR // Wayland libdecor mode
|
||||
},
|
||||
};
|
||||
|
||||
// The allocation function used when no custom allocator is set
|
||||
@@ -479,6 +482,9 @@ GLFWAPI void glfwInitHint(int hint, int value)
|
||||
case GLFW_X11_XCB_VULKAN_SURFACE:
|
||||
_glfwInitHints.x11.xcbVulkanSurface = value;
|
||||
return;
|
||||
case GLFW_WAYLAND_LIBDECOR:
|
||||
_glfwInitHints.wl.libdecorMode = value;
|
||||
return;
|
||||
}
|
||||
|
||||
_glfwInputError(GLFW_INVALID_ENUM,
|
||||
|
||||
Reference in New Issue
Block a user