kaydensigh / chromecalclock

A calendar and clock widget.
Apache License 2.0
19 stars 7 forks source link

Position of app is not remembered when using multiple monitors #13

Closed aaronfg closed 3 years ago

aaronfg commented 5 years ago

(This might be related to: https://github.com/kaydensigh/chromecalclock/issues/5)

Seems the app is not display-aware when using more than 1 display. Also buggy with different resolution on external monitor.

Hardware:

  1. Google Pixelbook (1200x800 default scaling)
  2. HDMI 1920x1080 monitor

Reproduction steps:

  1. hook up external monitor to chromebook as extended display, not mirroring
  2. pin clock app to toolbar
  3. open clock app and position clock to be in the bottom right corner of the 1080p monitor.
  4. click the app icon again to close it
  5. click the app icon again to open it.
  6. notice clock app does not appear on the external monitor (where it was before) but instead appears on the internal pixelbook display, 3/4ths off screen on the bottom right (due to resolution differences).

The clock will almost always default to opening on the pixelbook display on subsequent openings.

I'm not sure how much control you have over screen detecting, but at the very least there should be a check for screen.availWidth and screen.availHeight and if the saved position is outside of those bounds, reset it back to center.

edit: seems you can query the screens with: https://developer.chrome.com/apps/system_display and use the getInfo() method there. even has events for display changed.

kaydensigh commented 3 years ago

This is also a common issue from the Web Store feedback. Sorry I didn't notice issues filed to this repo in the past.

At this point Chrome Apps will be shut down soon, so I'm working on making this available as an extension. In that case, it's position will be fixed to the extension bar.

Alternatively, if anyone is willing to contribute, we could publish this as a PWA. There might not be a way to control the window location, but since they have better OS integration, it might remember the location natively.