Skip to content

Commit fbed7f0

Browse files
committed
v0.4 pre-release
1 parent 3d3be1e commit fbed7f0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/pywinctl/_pywinctl_macos.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ def getWindowsAt(x: int, y: int, allWindows: Optional[List[MacOSWindow]] = None)
328328
if pointInBox(x, y, box)]
329329

330330

331-
def getTopWindowAt(x: int, y: int, allWindows: Optional[List[MacOSWindow]] = None) -> MacOSWindow:
331+
def getTopWindowAt(x: int, y: int, allWindows: Optional[List[MacOSWindow]] = None) -> Optional[MacOSWindow]:
332332
"""
333333
Get *a* Window object at the point ``(x, y)`` on screen.
334334
Which window is not guaranteed. See https://github.com/Kalmat/PyWinCtl/issues/20#issuecomment-1193348238
@@ -429,7 +429,7 @@ def __init__(self, app: AppKit.NSRunningApplication, title: str):
429429
self._appName: str = self.getProcName(self._appPID)
430430
if not self._appName:
431431
# localizedName() is not recognized in AppleScript for non-English languages
432-
self._appName: str = app.localizedName()
432+
self._appName = app.localizedName()
433433
self._initTitle: str = title
434434
self._winTitle: str = title
435435
# self._parent = self.getParent() # It is slow and not required by now
@@ -1230,7 +1230,7 @@ def visible(self) -> bool:
12301230
12311231
:return: ``True`` if the window is currently visible
12321232
"""
1233-
return self._winTitle and self._winTitle in _getAppWindowsTitles(self._app)
1233+
return bool(self._winTitle and self._winTitle in _getAppWindowsTitles(self._app))
12341234

12351235
isVisible: bool = cast(bool, visible) # isVisible is an alias for the visible property.
12361236

0 commit comments

Comments
 (0)