feat(wayland): Window::SetAppId

xdg_toplevel.set_app_id, so the compositor can match the window to its
.desktop file: the icon, the task switcher, activation.
This commit is contained in:
Jorijn van der Graaf 2026-10-18 01:51:20 +02:00
commit 0d8287c122
Signed by: jorijnvdgraaf
GPG key ID: 2937E59CDCC1BCFB
2 changed files with 9 additions and 0 deletions

View file

@ -620,6 +620,12 @@ void Window::SetTitle(const std::string_view title) {
#endif
}
void Window::SetAppId(const std::string_view id) {
#ifdef CRAFTER_GRAPHICS_WINDOW_WAYLAND
xdg_toplevel_set_app_id(xdgToplevel, std::string(id).c_str());
#endif
}
void Window::SetTextInput(bool active, std::int32_t x, std::int32_t y, std::int32_t width, std::int32_t height, TextInputPurpose purpose) {
#ifdef CRAFTER_GRAPHICS_WINDOW_WAYLAND
textInputActive_ = active;

View file

@ -157,6 +157,9 @@ export namespace Crafter {
void StartUpdate();
void StopUpdate();
void SetTitle(const std::string_view title);
// The xdg app id, which the compositor matches to a .desktop file
// for the icon, the task switcher and activation.
void SetAppId(const std::string_view id);
// Tells the compositor's input method that a text field has focus
// (an on-screen keyboard opens) and where its caret is, in physical
// pixels, or that none has. Remembered: it is applied again whenever