我有一个文件选择器按钮,只要用它选择文件,就会触发标题栏中的更改。它似乎在我的非 flatpak 构建中运行良好。
import gtk.Application : Application;
import gtk.ApplicationWindow : ApplicationWindow;
import gio.Application : GioApp = Application;
import gtkc.gtktypes : GApplicationFlags, FileChooserAction;
import gtk.FileChooserButton : FileChooserButton;
const string AppID = `org.github.flatfcbtest`;
int main(string[] args)
{
auto app = new App();
return app.run(args);
}
public class App : Application
{
public:
this(const string appID = AppID, const GApplicationFlags flags = GApplicationFlags.FLAGS_NONE)
{
super(appID, flags);
addOnActivate(delegate void(GioApp _) {
auto pw = new PrimaryWindow(this);
pw.showAll();
});
}
}
class PrimaryWindow : ApplicationWindow
{
this(Application app)
{
super(app);
setSizeRequest(500, 300);
auto fcb = new FileChooserButton(`Select file`, FileChooserAction.OPEN);
fcb.addOnFileSet(delegate void (FileChooserButton _) {
setTitle(`file set!`);
});
add(fcb);
}
}
(GtkD 参考)
但是,在我的 flatpak 构建中,使用选择器按钮选择的文件没有选择任何内容,并且一直显示(无)。但是我的标题栏会相应地发生变化,所以我知道信号是由文件选择器按钮发出的。
这是我的 flatpak 权限列表:
finish-args:
- --socket=fallback-x11
- --share=ipc
- --filesystem=host
- --device=all
- --socket=session-bus
这是什么原因造成的?