mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-05 04:06:08 -05:00
toplevel-icon: set to app-id, instead of hardcoding to "foot"
And, special case "footclient", and map it to "foot".
This commit is contained in:
parent
0cb07027f2
commit
b34137dde3
2 changed files with 29 additions and 4 deletions
27
render.c
27
render.c
|
|
@ -4944,10 +4944,31 @@ render_refresh_app_id(struct terminal *term)
|
|||
};
|
||||
|
||||
timerfd_settime(term->render.app_id.timer_fd, 0, &timeout, NULL);
|
||||
} else {
|
||||
term->render.app_id.last_update = now;
|
||||
xdg_toplevel_set_app_id(term->window->xdg_toplevel, term->app_id ? term->app_id : term->conf->app_id);
|
||||
return;
|
||||
}
|
||||
|
||||
const char *app_id =
|
||||
term->app_id != NULL ? term->app_id : term->conf->app_id;
|
||||
|
||||
xdg_toplevel_set_app_id(term->window->xdg_toplevel, app_id);
|
||||
|
||||
#if defined(HAVE_XDG_TOPLEVEL_ICON)
|
||||
if (term->wl->toplevel_icon_manager != NULL) {
|
||||
struct xdg_toplevel_icon_v1 *icon =
|
||||
xdg_toplevel_icon_manager_v1_create_icon(
|
||||
term->wl->toplevel_icon_manager);
|
||||
|
||||
xdg_toplevel_icon_v1_set_name(
|
||||
icon, streq(app_id, "footclient") ? "foot" : app_id);
|
||||
|
||||
xdg_toplevel_icon_manager_v1_set_icon(
|
||||
term->wl->toplevel_icon_manager, term->window->xdg_toplevel, icon);
|
||||
|
||||
xdg_toplevel_icon_v1_destroy(icon);
|
||||
}
|
||||
#endif
|
||||
|
||||
term->render.app_id.last_update = now;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
|
|
@ -1813,9 +1813,13 @@ wayl_win_init(struct terminal *term, const char *token)
|
|||
|
||||
#if defined(HAVE_XDG_TOPLEVEL_ICON)
|
||||
if (wayl->toplevel_icon_manager != NULL) {
|
||||
const char *app_id =
|
||||
term->app_id != NULL ? term->app_id : term->conf->app_id;
|
||||
|
||||
struct xdg_toplevel_icon_v1 *icon =
|
||||
xdg_toplevel_icon_manager_v1_create_icon(wayl->toplevel_icon_manager);
|
||||
xdg_toplevel_icon_v1_set_name(icon, "foot");
|
||||
xdg_toplevel_icon_v1_set_name(icon, streq(
|
||||
app_id, "footclient") ? "foot" : app_id);
|
||||
xdg_toplevel_icon_manager_v1_set_icon(
|
||||
wayl->toplevel_icon_manager, win->xdg_toplevel, icon);
|
||||
xdg_toplevel_icon_v1_destroy(icon);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue