From fbed7f054f2737d837ace62fcd818635c33bc985 Mon Sep 17 00:00:00 2001 From: Kalmat Date: Wed, 17 Apr 2024 11:30:25 +0200 Subject: [PATCH] v0.4 pre-release --- src/pywinctl/_pywinctl_macos.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pywinctl/_pywinctl_macos.py b/src/pywinctl/_pywinctl_macos.py index e64dd93..b0088b1 100644 --- a/src/pywinctl/_pywinctl_macos.py +++ b/src/pywinctl/_pywinctl_macos.py @@ -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 @@ -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 @@ -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.