(catfish:24527): Gtk-WARNING **: 11:38:41.081: gtkwidget.c:8584: widget not within a GtkWindow
Traceback (most recent call last):
File "/usr/bin/catfish", line 42, in <module>
File "/usr/lib/python3.7/site-packages/catfish/__init__.py", line 76, in main
window = CatfishWindow.CatfishWindow()
File "/usr/lib/python3.7/site-packages/catfish_lib/Window.py", line 169, in __new__
File "/usr/lib/python3.7/site-packages/catfish/CatfishWindow.py", line 274, in finish_initializing
(display_width, display_height) = self.get_display_size()
File "/usr/lib/python3.7/site-packages/catfish/CatfishWindow.py", line 321, in get_display_size
m = s.get_monitor_at_window(s.get_active_window())
TypeError: Argument 1 does not allow None as a value
- catfish 1.4.7-1
- sway 1.0-8
- wayland 1.17.0-1
- xorg-server-xwayland 1.20.4-1
- linux 5.0.7.arch1-1
Description: Crashes on startup.
Created attachment 8498
Avoid None type on Wayland session
This patch fixes None type on Wayland session. As Catfish is deeply linked to X11, firstly we must check which session is used (if not X11, no window).
Then, Wayland users are encouraged to run Catfish with the following command GDK_BACKEND=x11 catfish
Gdk.Screen.get_active_window returns None if we are not on X11 session (moreover it is deprecated since Gtk 3.22), so I suggest to use Gdk.Display.get_monitor_at_window instead.
Olivier Duchateau referenced this bugreport in commit 9caeadd8b32f443809debbad4596a1956c43995d
Avoid None type on Wayland session (patched) (bug #15297)
It required a few minor adjustments, but overall the patch worked! Applied above.