kasper / phoenix

A lightweight macOS window and app manager scriptable with JavaScript

Home Page:https://kasper.github.io/phoenix/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Wrong return type for Window.screen

fabiospampinato opened this issue · comments

  • Version: 3.0.0
  • macOS: 12.5.1

Apparently it's possible for a window to be in no screen, while still not being minimized, so the return type of Window.screen should probably be Screen | undefined I guess.

To reproduce:

  1. Get the cursor close to the top edge of a window, so that the cursor turns into the vertical resize arrows.
  2. Drag horizontally, to initiate a drag of the window.
  3. Drag the window as far bottom as possible.
  4. If done correctly the window will be out of bounds of screen, and calling .screen () on it will return you undefined back.

I suppose a window can also be positioned out of the bounds of the screen via the APIs?

Alternatively it may be interesting if this was automatically normalized so that the closest screen were returned, if that makes sense 🤔

Interesting catch, thanks!