Compare commits

..

2 commits

Author SHA1 Message Date
icefox
0c360e6e23
Allow setting XDG application ID on wayland
Some checks are pending
CI / x86_64-linux (push) Waiting to run
CI / x86_64-windows (push) Waiting to run
CI / x86_64-macos (push) Waiting to run
2026-01-10 16:32:30 -03:00
icefox
b31f471fb4
call c.xdg_toplevel_set_title before first commit of surface 2026-01-10 16:24:40 -03:00
2 changed files with 6 additions and 2 deletions

View file

@ -24,6 +24,9 @@ windows: mach.Objects(
// TODO: allocation/free strategy // TODO: allocation/free strategy
title: [:0]const u8 = "Mach Window", title: [:0]const u8 = "Mach Window",
// XDG application ID of the window
app_id: [:0]const u8 = "",
/// Texture format of the framebuffer (read-only) /// Texture format of the framebuffer (read-only)
framebuffer_format: gpu.Texture.Format = .bgra8_unorm, framebuffer_format: gpu.Texture.Format = .bgra8_unorm,

View file

@ -176,6 +176,9 @@ pub fn initWindow(
core_window = core.windows.getValue(window_id); core_window = core.windows.getValue(window_id);
wl = &core_window.native.?.wayland; wl = &core_window.native.?.wayland;
c.xdg_toplevel_set_title(wl.toplevel, @ptrCast(core_window.title));
c.xdg_toplevel_set_app_id(wl.toplevel, @ptrCast(core_window.app_id));
// Commit changes to surface // Commit changes to surface
c.wl_surface_commit(wl.surface); c.wl_surface_commit(wl.surface);
@ -188,8 +191,6 @@ pub fn initWindow(
if (result != -1 and wl.configured) break; if (result != -1 and wl.configured) break;
} }
c.xdg_toplevel_set_title(wl.toplevel, @ptrCast(core_window.title));
const decoration = c.zxdg_decoration_manager_v1_get_toplevel_decoration( const decoration = c.zxdg_decoration_manager_v1_get_toplevel_decoration(
wl.interfaces.zxdg_decoration_manager_v1, wl.interfaces.zxdg_decoration_manager_v1,
wl.toplevel, wl.toplevel,