mirror of
https://github.com/glfw/glfw.git
synced 2026-09-22 16:52:57 +00:00
Wayland: Add GLFW_WAYLAND_APP_ID window hint
This adds a window hint string for the xdg_toplevel::app_id, which is used by desktop environments to connect windows with application icons and other information. This is similar to the WM_CLASS property on X11. A few very minor fixes were done by @elmindreda during merge. Fixes #2121 Closes #2122
This commit is contained in:
committed by
Camilla Löwy
parent
26b85215c0
commit
b9ed25d2e9
@@ -614,6 +614,9 @@ static GLFWbool createShellObjects(_GLFWwindow* window)
|
||||
|
||||
xdg_toplevel_add_listener(window->wl.xdg.toplevel, &xdgToplevelListener, window);
|
||||
|
||||
if (window->wl.appId)
|
||||
xdg_toplevel_set_app_id(window->wl.xdg.toplevel, window->wl.appId);
|
||||
|
||||
if (window->wl.title)
|
||||
xdg_toplevel_set_title(window->wl.xdg.toplevel, window->wl.title);
|
||||
|
||||
@@ -728,6 +731,7 @@ static GLFWbool createNativeSurface(_GLFWwindow* window,
|
||||
window->wl.height = wndconfig->height;
|
||||
window->wl.scale = 1;
|
||||
window->wl.title = _glfw_strdup(wndconfig->title);
|
||||
window->wl.appId = _glfw_strdup(wndconfig->wl.appId);
|
||||
|
||||
window->wl.maximized = wndconfig->maximized;
|
||||
|
||||
@@ -1865,6 +1869,7 @@ void _glfwDestroyWindowWayland(_GLFWwindow* window)
|
||||
wl_surface_destroy(window->wl.surface);
|
||||
|
||||
_glfw_free(window->wl.title);
|
||||
_glfw_free(window->wl.appId);
|
||||
_glfw_free(window->wl.monitors);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user