Skip to content

Commit a76999f

Browse files
committed
ALL: Added getAllWindowsDict() general function. Added getPID() method.
LINUX: Added bad window filter to check for window.id == 0
1 parent 64dd85d commit a76999f

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/pywinctl/_pywinctl_linux.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -799,9 +799,9 @@ def getHandle(self) -> int:
799799

800800
def getPID(self) -> Optional[int]:
801801
"""
802-
Get the current application PID
802+
Get the current application PID the window belongs to
803803
804-
:return: application PID
804+
:return: application PID or None if it couldn't be retrieved
805805
"""
806806
return self._win.getPid()
807807

src/pywinctl/_pywinctl_macos.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1143,9 +1143,9 @@ def getHandle(self) -> Tuple[str, str]:
11431143

11441144
def getPID(self) -> Optional[int]:
11451145
"""
1146-
Get the current application PID
1146+
Get the current application PID the window belongs to
11471147
1148-
:return: application PID
1148+
:return: application PID or None if it couldn't be retrieved
11491149
"""
11501150
cmd = """osascript -s 's' -e 'tell application "System Events"
11511151
set appPID to "0"

src/pywinctl/_pywinctl_win.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -886,9 +886,9 @@ def getHandle(self) -> int:
886886

887887
def getPID(self) -> Optional[int]:
888888
"""
889-
Get the current application PID
889+
Get the current application PID the window belongs to
890890
891-
:return: application PID
891+
:return: application PID or None if it couldn't be retrieved
892892
"""
893893
ret = win32process.GetWindowThreadProcessId(self._hWnd)
894894
if ret and len(ret) > 1:

0 commit comments

Comments
 (0)