New issue
Advanced search Search tips

Issue 889321 link

Starred by 1 user

Issue metadata

Status: Untriaged
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 3
Type: Bug



Sign in to add a comment

Should we allow invisible windows to receive focus?

Project Member Reported by afakhry@chromium.org, Sep 26

Issue description

This issue is forked from  issue 847179 . 

While I was investigating that bug, I found that it's possible that we actually set focus on an invisible window. (See comment #6 in  issue 847179 ).


I tried changing Window::CanFocus() by adding a check for visibility after the first check for root winodws, essentially making it look like:

bool Window::CanFocus() const {
  if (IsRootWindow())
    return IsVisible();

  if (!IsVisible())
    return false;

  ....
}

This fixed  issue 847179 , but reading this comment in [1] made me question this solution, so I didn't go forward with this fix.

  // NOTE: as part of focusing the window the ActivationClient may make the
  // window visible (by way of making a hidden ancestor visible). For this
  // reason we can't check visibility here and assume the client is doing it.

[1]: https://chromium.googlesource.com/chromium/src/+/0970add0c5df6be31505bf21f4f4f22992faa0b5/ui/aura/window.cc#653


This bug is here to think about what needs to be done, so that I can close  issue 847179 .
 
I think we should allow the request through, but if the window isn't visible at the end, don't let it have focus. I'm specifically suggesting some where in FocusController it reverts if the window isn't visible.
We should be able to set focus to minimized window which isn't visible, iirc.
There may be a better way to handle it though.

Sign in to add a comment