Skip to content

[BUG] Missing handling of case where no property is obtained within getWmPid #22

Description

@omlins

MWE:

import PySimpleGUI
import pywinctl

PySimpleGUI.popup('just say it!', 
        no_titlebar = False,
        keep_on_top = True,
        title = "dummy title",
        non_blocking = True,
        )

pywinctl.getAllAppsWindowsTitles()

Resulting error:

$ /bin/python3 /home/omlins/tmpwdir/juliadev/JustSayIt/src/gui_test2.py
Traceback (most recent call last):
  File "/home/omlins/tmpwdir/juliadev/JustSayIt/src/gui_test2.py", line 11, in <module>
    pywinctl.getAllAppsWindowsTitles()
  File "/home/omlins/.local/lib/python3.10/site-packages/pywinctl/_pywinctl_linux.py", line 235, in getAllAppsWindowsTitles
    appName = win.getAppName()
  File "/home/omlins/.local/lib/python3.10/site-packages/pywinctl/_pywinctl_linux.py", line 763, in getAppName
    pid = EWMH.getWmPid(self._hWnd)
  File "/home/omlins/.local/lib/python3.10/site-packages/ewmh/ewmh.py", line 400, in getWmPid
    return self._getProperty('_NET_WM_PID', win)[0]
TypeError: 'NoneType' object is not subscriptable

NOTE: The error occurred also when having a window open created with turtle. Thus, the problem does not only occur with PySimpleGUI, but probably with all GUIs that underneath rely on tkinter.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions