Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
omlins opened this issue Jan 20, 2023 · 1 comment

Comments

@omlins
Copy link

omlins commented Jan 20, 2023

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.

@MestreLion
Copy link

This was already fixed in acd5869 . Unfortunately no new tag or released since then, here on Github or Pypi.

A workaround, if installing using pip, is pointing it here instead of Pypi:

$ pip install 'ewmh @ git+https://github.com/parkouss/pyewmh'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants