Gtk::Window 图标集 set_icon_name 在 wayland 上不起作用
Gtk::Window icon set with set_icon_name doesn't work on wayland
我正在尝试通过测试这个示例程序来解决 a synfig issue:
#include <gtkmm.h>
#include <iostream>
class HelloWindow : public Gtk::Window {
public:
HelloWindow();
~HelloWindow();
};
HelloWindow::HelloWindow()
{
set_icon_name("org.synfig.SynfigStudio"); // <- name copied from synfig build
property_title() = "Hello Window";
property_default_width() = 320;
property_default_height() = 240;
present();
}
HelloWindow::~HelloWindow()
{
}
int main()
{
Glib::RefPtr<Gtk::Application> app = Gtk::Application::create("org.gtkmm.Hello");
HelloWindow hello;
return app->run(hello);
}
我将 synfig hicolor 图标复制到我的 ~/.icons/ 目录。
在运行示例程序中,图标显示在X11 GNOME会话中
- top panel screenshot
- overview panel screenshot
然而,在 Wayland 上,我得到可执行图标作为替换
- top panel screenshot
- overview panel screenshot
此外,尝试使用预安装的系统图标,例如 "org.gnome.Calculator"
window 图标适用于 X11 但不适用于 Wayland
答案不是我的。来自 GTK irc 的用户提供了这个,我只是引用了对话
聊天记录如下:Riot | GTK
以及引用的答案
normally you have a desktop file
and the icon (and the name) are used from there
so if synfig studio doens't have one, well, add one
我正在尝试通过测试这个示例程序来解决 a synfig issue:
#include <gtkmm.h>
#include <iostream>
class HelloWindow : public Gtk::Window {
public:
HelloWindow();
~HelloWindow();
};
HelloWindow::HelloWindow()
{
set_icon_name("org.synfig.SynfigStudio"); // <- name copied from synfig build
property_title() = "Hello Window";
property_default_width() = 320;
property_default_height() = 240;
present();
}
HelloWindow::~HelloWindow()
{
}
int main()
{
Glib::RefPtr<Gtk::Application> app = Gtk::Application::create("org.gtkmm.Hello");
HelloWindow hello;
return app->run(hello);
}
我将 synfig hicolor 图标复制到我的 ~/.icons/ 目录。
在运行示例程序中,图标显示在X11 GNOME会话中
- top panel screenshot
- overview panel screenshot
然而,在 Wayland 上,我得到可执行图标作为替换
- top panel screenshot
- overview panel screenshot
此外,尝试使用预安装的系统图标,例如 "org.gnome.Calculator"
window 图标适用于 X11 但不适用于 Wayland
答案不是我的。来自 GTK irc 的用户提供了这个,我只是引用了对话
聊天记录如下:Riot | GTK
以及引用的答案
normally you have a desktop file
and the icon (and the name) are used from there
so if synfig studio doens't have one, well, add one