zotero / zotero-google-docs-integration

32 stars 6 forks source link

Improve window/dialog focusing in Google Docs #69

Closed dstillman closed 1 year ago

dstillman commented 1 year ago

In testing https://github.com/zotero/zotero-connectors/issues/423 on Windows, I found lots of cases where something opened by the plugin didn't properly get focused. E.g., currently when opening Doc Prefs via either the keyboard or the mouse, the window appears in front but doesn't have focus, and the Google Doc still has keyboard focus, which I imagine is particularly confusing and disruptive if you're using a screen reader.

After restarting Zotero and testing with the keyboard, it's opening Doc Prefs behind the browser window every time.

Using the keyboard with Zotero closed, it also sometimes opens the "Is Zotero Running?" dialog but leaves focus in the Google Doc, which is really bad if you're using the keyboard, since then you can't close it at all — I think you just have to reload the page.

Anything we can do to make all of this work more consistently would be good.

adomasven commented 1 year ago

Regarding window focus, I have investigated this a few years ago and there's nothing we can do. OSes have kind of arbitrary rules for when they decide to bring windows to front and they don't allow to programatically control this even with very low-level access. This was not always the case but things got heavily locked down in the last few years.

We can probably make the "Is Zotero Running" dialog get focus more consistently.