mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-06 16:05:05 +02:00
Wayland: Allow hiding window decorations on compositors with SSD as well
This commit is contained in:
@@ -87,6 +87,8 @@ Detailed list of changes
|
||||
|
||||
- Wayland: A new option :opt:`wayland_enable_ime` to turn off Input Method Extensions which add latency and create bugs
|
||||
|
||||
- Wayland: Fix :opt:`hide_window_decorations` not working on non GNOME desktops
|
||||
|
||||
0.33.1 [2024-03-21]
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
|
||||
41
glfw/wl_window.c
vendored
41
glfw/wl_window.c
vendored
@@ -871,26 +871,23 @@ static const struct xdg_surface_listener xdgSurfaceListener = {
|
||||
static void
|
||||
setXdgDecorations(_GLFWwindow* window)
|
||||
{
|
||||
if (_glfw.wl.decorationManager)
|
||||
{
|
||||
if (window->wl.xdg.decoration) {
|
||||
window->wl.decorations.serverSide = true;
|
||||
window->wl.xdg.decoration =
|
||||
zxdg_decoration_manager_v1_get_toplevel_decoration(
|
||||
_glfw.wl.decorationManager, window->wl.xdg.toplevel);
|
||||
zxdg_toplevel_decoration_v1_add_listener(window->wl.xdg.decoration,
|
||||
&xdgDecorationListener,
|
||||
window);
|
||||
zxdg_toplevel_decoration_v1_set_mode(
|
||||
window->wl.xdg.decoration,
|
||||
ZXDG_TOPLEVEL_DECORATION_V1_MODE_SERVER_SIDE);
|
||||
}
|
||||
else
|
||||
{
|
||||
zxdg_toplevel_decoration_v1_set_mode(window->wl.xdg.decoration, window->decorated ? ZXDG_TOPLEVEL_DECORATION_V1_MODE_SERVER_SIDE: ZXDG_TOPLEVEL_DECORATION_V1_MODE_CLIENT_SIDE);
|
||||
} else {
|
||||
window->wl.decorations.serverSide = false;
|
||||
ensure_csd_resources(window);
|
||||
}
|
||||
}
|
||||
|
||||
void _glfwPlatformSetWindowDecorated(_GLFWwindow* window, bool enabled UNUSED) {
|
||||
setXdgDecorations(window);
|
||||
if (window->decorated) ensure_csd_resources(window); else free_csd_surfaces(window);
|
||||
inform_compositor_of_window_geometry(window, "SetWindowDecorated");
|
||||
commit_window_surface_if_safe(window);
|
||||
}
|
||||
|
||||
|
||||
static struct wl_output*
|
||||
find_output_by_name(const char* name) {
|
||||
if (!name) return NULL;
|
||||
@@ -1047,6 +1044,11 @@ create_window_desktop_surface(_GLFWwindow* window)
|
||||
xdg_toplevel_add_listener(window->wl.xdg.toplevel,
|
||||
&xdgToplevelListener,
|
||||
window);
|
||||
if (_glfw.wl.decorationManager) {
|
||||
window->wl.xdg.decoration = zxdg_decoration_manager_v1_get_toplevel_decoration(
|
||||
_glfw.wl.decorationManager, window->wl.xdg.toplevel);
|
||||
zxdg_toplevel_decoration_v1_add_listener(window->wl.xdg.decoration, &xdgDecorationListener, window);
|
||||
}
|
||||
|
||||
if (window->wl.title)
|
||||
xdg_toplevel_set_title(window->wl.xdg.toplevel, window->wl.title);
|
||||
@@ -1644,17 +1646,6 @@ void _glfwPlatformSetWindowResizable(_GLFWwindow* window UNUSED, bool enabled UN
|
||||
"Wayland: Window attribute setting not implemented yet");
|
||||
}
|
||||
|
||||
void _glfwPlatformSetWindowDecorated(_GLFWwindow* window, bool enabled)
|
||||
{
|
||||
if (!window->monitor)
|
||||
{
|
||||
if (enabled)
|
||||
ensure_csd_resources(window);
|
||||
else
|
||||
free_csd_surfaces(window);
|
||||
}
|
||||
}
|
||||
|
||||
void _glfwPlatformSetWindowFloating(_GLFWwindow* window UNUSED, bool enabled UNUSED)
|
||||
{
|
||||
// TODO
|
||||
|
||||
Reference in New Issue
Block a user