Open saligari opened 5 years ago
I can confirm this issue. What is puzzling is that another Tumbleweed install of mine (relatively close in configuration, but things will always differ) does not suffer from this issue.
Tested with a newly created user, just to check, happens for "him" too, so it doesn't seem to stem from a user-related config.
Also, tried to replace unity-gtk-module by appmenu-gtk-module, but to no avail.
I wonder if this has to do with these deprecation warnings I've seen for a while.
(plasma-hud:19288): Gtk-WARNING **: 23:58:33.000: Theme parsing error: gtk.css:68:35: The style property GtkButton:child-displacement-x is deprecated and shouldn't be used anymore. It will be removed in a future version
(plasma-hud:19288): Gtk-WARNING **: 23:58:33.000: Theme parsing error: gtk.css:69:35: The style property GtkButton:child-displacement-y is deprecated and shouldn't be used anymore. It will be removed in a future version
(plasma-hud:19288): Gtk-WARNING **: 23:58:33.001: Theme parsing error: gtk.css:73:46: The style property GtkScrolledWindow:scrollbars-within-bevel is deprecated and shouldn't be used anymore. It will be removed in a future version
Maybe it's the DPI calculation, no clue.
Oh, it happens even with this HelloWorld example: https://pygobject.readthedocs.io/en/latest/getting_started.html
import gi
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk
window = Gtk.Window(title="Hello World")
window.show()
window.connect("destroy", Gtk.main_quit)
Gtk.main()
Can you @Zren run this on Manjaro?
Update:
From this: https://gitlab.gnome.org/GNOME/pygobject/issues/298 If I use Gtk.init(), the helloworld code will run well.
Can this be applied?
Does the mate-hud
script segfault for you guys too? It might not since it creates a Gtk global shortcut and settings which might call whatever is necessary.
Yep, runs fine. I guess ya'll need me to add Gtk.init()
somewhere? Could you try adding it to __main__
in plasma-hud
, before DBusGMainLoop
?
https://github.com/Zren/plasma-hud/blob/master/usr/lib/plasma-hud/plasma-hud#L609
Does the
mate-hud
script segfault for you guys too? It might not since it creates a Gtk global shortcut and settings which might call whatever is necessary.
I haven't tested it but I believe it will crash because of this line: https://github.com/ubuntu-mate/mate-hud/blob/master/usr/lib/mate-hud/mate-hud#L172 as I said above..
You can see this:
Python 3.7.3 (default, Apr 09 2019, 05:18:21) [GCC] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import gi
>>> gi.require_version("Gtk", "3.0")
>>> from gi.repository import Gtk
>>> Gtk.Window()
(process:5346): Gtk-CRITICAL **: 09:12:00.287: _gtk_style_provider_private_get_settings: assertion 'GTK_IS_STYLE_PROVIDER_PRIVATE (provider)' failed
(process:5346): Gtk-CRITICAL **: 09:12:00.287: _gtk_style_provider_private_get_settings: assertion 'GTK_IS_STYLE_PROVIDER_PRIVATE (provider)' failed
(process:5346): Gtk-CRITICAL **: 09:12:00.287: _gtk_style_provider_private_get_settings: assertion 'GTK_IS_STYLE_PROVIDER_PRIVATE (provider)' failed
Segmentation fault (core dumped)
Yep, runs fine. I guess ya'll need me to add
Gtk.init()
somewhere? Could you try adding it to__main__
inplasma-hud
, beforeDBusGMainLoop
?https://github.com/Zren/plasma-hud/blob/master/usr/lib/plasma-hud/plasma-hud#L609
Yes, that fixes it. And Gtk.init_check()
fixes it too. But I don't know what is the difference between these 2 functions.
After a quick search, I think these are similar. And that page says:
Call this function (init) before using any other GTK+ functions in your GUI applications.
So I think this is kinda necessary.
Gtk.init_check()
is probably the same, but lets the application print some debug/error messages before terminating the app. Maybe it's also designed for allowing the app to retry the init.
I'll toss a Gtk.init()
there as it still works for me.
I can confirm this solves the issue for me. Thank you both for tracking down and fixing this issue!
I've tried to install plasma-hud on openSUSE Tumbleweed, I have installed on my system these:
rofi python3 python3-dbus-python python3-setproctitle python3-python-xlib gobject-introspection unity-gtk2-module unity-gtk3-module
I perform the steps of the manual setup, and when I run the script: /usr/lib/plasma-hud/plasma-hud it hangs until I press the hot key to activate it and I get this error (x3) _gtk_style_provider_private_get_settings: assertion GTK_IS_STYLE_PROVIDER_PRIVATE (provider)' failed
Is there something obviously wrong that I'm missing? What could be at fault here?
Thanks!