! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
get_active_window() returns None
Status:
RESOLVED: FIXED
Product:
Catfish
Component:
General

Comments

Description a 2019-04-17 18:47:56 CEST
(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>
    catfish.main()
  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__
    new_object.finish_initializing(builder)
  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

---

Details:
- 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.
Comment 1 Olivier Duchateau 2019-05-08 22:12:01 CEST
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.
Comment 2 Git Bot editbugs 2019-07-22 19:36:17 CEST
Olivier Duchateau referenced this bugreport in commit 9caeadd8b32f443809debbad4596a1956c43995d

Avoid None type on Wayland session (patched) (bug #15297)

https://git.xfce.org/apps/catfish/commit?id=9caeadd8b32f443809debbad4596a1956c43995d
Comment 3 Sean Davis editbugs 2019-07-22 19:36:57 CEST
It required a few minor adjustments, but overall the patch worked! Applied above.

Bug #15297

Reported by:
a
Reported on: 2019-04-17
Last modified on: 2019-07-22

People

Assignee:
Sean Davis
CC List:
1 user

Version

Attachments

Avoid None type on Wayland session (4.19 KB, patch)
2019-05-08 22:12 CEST , Olivier Duchateau
no flags

Additional information