Skip to content

Commit

Permalink
v0.4 pre-release
Browse files Browse the repository at this point in the history
  • Loading branch information
Kalmat committed Apr 17, 2024
1 parent 3d3be1e commit fbed7f0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/pywinctl/_pywinctl_macos.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ def getWindowsAt(x: int, y: int, allWindows: Optional[List[MacOSWindow]] = None)
if pointInBox(x, y, box)]


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

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

Expand Down

0 comments on commit fbed7f0

Please sign in to comment.