Skip to content

Commit

Permalink
ALL: Added getAllWindowsDict() general function. Added getPID() method.
Browse files Browse the repository at this point in the history
LINUX: Added bad window filter to check for window.id == 0
  • Loading branch information
Kalmat committed Sep 23, 2024
1 parent d8ac48c commit 64dd85d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/pywinctl/_pywinctl_linux.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ def getAllWindowsDict(tryToFilter: bool = False) -> dict[str, int | dict[str, in
"""
result: dict[str, int | dict[str, int | dict[str, str | dict[str, int | Point | Size | str]]]] = {}
for win in getAllWindows():
id = win.getHandle()
winId = win.getHandle()
appName = win.getAppName()
appPID = win._win.getPid()
status = 0
Expand All @@ -295,7 +295,7 @@ def getAllWindowsDict(tryToFilter: bool = False) -> dict[str, int | dict[str, in
elif win.isMaximized:
status = 2
winDict = {
"id": id,
"id": winId,
"display": win.getDisplay(),
"position": win.position,
"size": win.size,
Expand Down
6 changes: 3 additions & 3 deletions src/pywinctl/_pywinctl_win.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,8 +254,8 @@ def getAllWindowsDict(tryToFilter: bool = False) -> dict[str, int | dict[str, in
process_list = _getAllApps(tryToFilter)
result: dict[str, int | dict[str, int | dict[str, str | dict[str, int | Point | Size | str]]]] = {}
for win in getAllWindows():
id = win.getHandle()
pID = win32process.GetWindowThreadProcessId(id)
winId = win.getHandle()
pID = win32process.GetWindowThreadProcessId(winId)
for item in process_list:
appPID = item[0]
appName = str(item[1])
Expand All @@ -266,7 +266,7 @@ def getAllWindowsDict(tryToFilter: bool = False) -> dict[str, int | dict[str, in
elif win.isMaximized:
status = 2
winDict = {
"id": id,
"id": winId,
"display": win.getDisplay(),
"position": win.position,
"size": win.size,
Expand Down

0 comments on commit 64dd85d

Please sign in to comment.