I have recently been learning how to program with the Clutter GUI toolkit. One thing I haven't been able to figure out is how to set the programs title and icon for the window manager.

As illustrated in the image below, Gnome Shell says that the program name is "Unknown" and that the program does not have an icon.

enter image description here

So, how do I do this?

有帮助吗?

解决方案

you cannot do this from Clutter: the windowing system API inside Clutter only allows basic operations.

if you want proper integration in a windowing system you should use Clutter-GTK, and embed a ClutterStage into a Gtk application.

其他提示

In theory, you can do that in this way:

let stage = Clutter.Stage.get_default ();
let gdkWind = ClutterGdk.get_stage_window (stage);
// The list most containt icons in different sizes.
let list = [GdkPixbuf.Pixbuf.new_from_file("test.png")];
gdkWind.set_icon_list(list);
//The next line not work 
gdkWind.set_title("This title is not added");

In practice, you only will can load the icon and the windows title, but not the task bar title for the windows. The set_title won't work as Gdk.Window reference say it will (https://people.gnome.org/~gcampagna/docs/Gdk-3.0/Gdk.Window.set_title.html). Is then a Clutter issue, because is not a GDK "special case". But well is not working.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top