gtk_status_icon_is_embedded 在 Gnome3 和 xfce4 上始终返回 False
我最近一直在试图弄清楚 *gtk_status_icon_is_embedded()* 是如何工作的,我找到了一个关于 GtkStatusIcon 的教程 here< /a>.我在 Gnome3 和 xfce4 上尝试了示例程序。两个 DM 上都可以看到状态图标,但无论我如何努力,该方法始终返回 FALSE。有人可以帮我解释一下吗?
提前致谢!
I've been trying to figure out how *gtk_status_icon_is_embedded()* works recently and I've found a tutorial about GtkStatusIcon here. I tried the sample program on both Gnome3 and xfce4. The status icon can be seen on both DMs, but the method always returns FALSE no matter how hard I tried. Anyone can shed me some light please?
Thanks in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
事实证明,与 UI 相关的所有事情都最好在主循环中完成,而不仅仅是更新。也就是说,这是经过修改的示例程序,具有有效的通知区域检测功能。
现在该程序有效了,但仍然存在一个问题。为什么在不实例化状态图标的情况下无法检查通知区域的可用性?如果我们在程序启动时能够获得该信息,则可以节省很多工作。是因为 freedesktop 的规格吗?还是执行上的问题?
如果您碰巧知道背后的原因,请在评论中删除一两行,我们将不胜感激。
It turned out that everything related to UI has better to be done in the main loop, not only updates. That said, here is the modified sample program with notification area detection which works.
Now the program worked, but a question still remains. Why there is no way to check the availability of notification area without instantiating a status icon? A lot of works can be saved if we could have that piece of info when the program starts. Is it due to the specs of the freedesktop? Or is it an implementation problem?
If you happened to know the reason(s) behind, it would be very appreciated if you could drop a line or two in the comments.