我在从终端启动 gedit 时遇到了这些警告。最终 gedit 启动了,但每次启动 gedit 时都会出现以下警告行:
(gedit:3830): Gtk-WARNING **: Theme parsing error: gtk-widgets.css:138:20: Not using units is deprecated. Assuming 'px'.
(gedit:3830): Gtk-WARNING **: Theme parsing error: gtk-widgets.css:138:24: Not using units is deprecated. Assuming 'px'.
(gedit:3830): Gtk-WARNING **: Theme parsing error: gtk-widgets.css:138:28: Not using units is deprecated. Assuming 'px'.
(gedit:3830): Gtk-WARNING **: Theme parsing error: gtk-widgets.css:138:32: Not using units is deprecated. Assuming 'px'.
(gedit:3830): Gtk-WARNING **: Theme parsing error: gtk-widgets.css:2237:26: 'none' is not a valid color name
(gedit:3830): Gtk-WARNING **: Theme parsing error: gtk-widgets.css:2264:20: Not using units is deprecated. Assuming 'px'.
(gedit:3830): Gtk-WARNING **: Theme parsing error: gtk-widgets.css:2264:24: Not using units is deprecated. Assuming 'px'.
(gedit:3830): Gtk-WARNING **: Theme parsing error: gtk-widgets.css:2264:28: Not using units is deprecated. Assuming 'px'.
(gedit:3830): Gtk-WARNING **: Theme parsing error: gtk-widgets.css:2264:32: Not using units is deprecated. Assuming 'px'.
(gedit:3830): Gtk-WARNING **: Theme parsing error: sidebar.css:22:20: Not using units is deprecated. Assuming 'px'.
(gedit:3830): Gtk-WARNING **: Theme parsing error: sidebar.css:40:18: Not using units is deprecated. Assuming 'px'.
(gedit:3830): Gtk-WARNING **: Theme parsing error: sidebar.css:40:20: Not using units is deprecated. Assuming 'px'.
** (gedit:3830): WARNING **: Could not load Gedit repository: Typelib file for namespace 'GtkSource', version '3.0' not found
(gedit:3830): Gtk-WARNING **: Calling Inhibit failed: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.gnome.SessionManager was not provided by any .service files
(gedit:3830): Gtk-WARNING **: Calling Inhibit failed: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.gnome.SessionManager was not provided by any .service files
答案1
更新 gir1.2-gtksource-3.0 解决了我的问题;错误不再出现。
sudo apt-get install gir1.2-gtksource-3.0
答案2
通常这些警告表示应用程序开发不良,但程序员通常会忽略它们。这不是一个严重问题,如果程序按预期运行,则可以安全地忽略它们。
顺便说一句,问题似乎出在主题没有px
在 CSS 中声明。您可以去编辑siderbar.css
并在第 40 行和第 22 行进行更正。在gtk-wirdgets.css
第 2264、2237 和 138 行。有多个实例。这是针对“主题解析错误”,而且似乎您错过了 SessionManager 包并且 GtkSource 不是版本 3。
答案3
我认为使用gksudo
instad ofsudo
将阻止这些警告的出现!