New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 866760 link

Starred by 5 users

Issue metadata

Status: Fixed
Owner:
Closed: Aug 6
Cc:
Components:
EstimatedDays: ----
NextAction: 2018-08-02
OS: Mac
Pri: 1
Type: Bug-Regression



Sign in to add a comment

Window navigation/reload causes space switch

Project Member Reported by chrishtr@chromium.org, Jul 24

Issue description

Chrome Version       : 69.0.3493.3
OS Version: OS X 10.13.6
URLs (if applicable) :
Other browsers tested:
  Add OK or FAIL after other browsers where you have tested this issue:
     Safari:
    Firefox:
    IE/Edge:

What steps will reproduce the problem?
1. Open two windows, on different OS X screens (the things you can ctrl-left and ctrl-right between)
2. Load sites on window simultaneously, but looking at one of them

What is the expected result?

The site I'm looking at stays focused

What happens instead of that?

The two sites keep stealing focus and automatic OS X animations happen back and forth between the screens multiple times.


UserAgentString: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3493.3 Safari/537.36



 
Labels: Needs-Triage-M69
Labels: Needs-Feedback Triaged-ET
Unable to reproduce the issue on chrome reported version# 69.0.3493.3 using Mac 10.12.6 with steps mentioned below:
1) Launched chrome reported version and opened another chrome windows window on other OS screen
2) Loaded sites simultaneously on both windows, only the windows stayed focus which i am looking and didn't observed any change in focus.

@Reporter: Please find the attached screencast for your reference and let us know if we missed anything in reproducing the issue, provide your feedback on it which help in further triaging it.

Thanks!
866760.mp4
6.1 MB View Download
Labels: Proj-MacViews
+Proj-MacViews
I can easily reproduce by loading a gmail in two different profiles, one
on each desktop screen. It'll shift focus back and forth and move between the
screens.
Project Member

Comment 5 by sheriffbot@chromium.org, Jul 30

Cc: viswa.karala@chromium.org
Labels: -Needs-Feedback
Thank you for providing more feedback. Adding the requester to the cc list.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Cc: spqc...@chromium.org ellyjo...@chromium.org
Components: UI>Browser>StatusBubble
Labels: -Type-Bug -Pri-3 ReleaseBlock-Stable Pri-1 Type-Bug-Regression
Status: Untriaged (was: Unconfirmed)
Summary: Window navigation/reload causes space switch (was: Windows on different screens stealing focus back and forth)
This sounds like a super old Cocoa bug which has a rdar associated -  Issue 31821 

There's also  Issue 697829 

Likely we need the workaround on  Issue 31821  for the views status bubble.
Labels: M-69 Target-69 FoundIn-69
Owner: tapted@chromium.org
Status: Started (was: Untriaged)
Yeah that does the trick --> https://chromium-review.googlesource.com/c/chromium/src/+/1155274
Project Member

Comment 9 by bugdroid1@chromium.org, Jul 31

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/ed7b111010b7f64504b2e874d9f4f6d9db0021fd

commit ed7b111010b7f64504b2e874d9f4f6d9db0021fd
Author: Trent Apted <tapted@chromium.org>
Date: Tue Jul 31 21:01:35 2018

MacViewsBrowser: Never orderOut: the status bubble, nor order it in again.

Doing so requires it to detached and re-attached as a child window of
the browser. Even though the status bubble has
NSWindowCollectionBehaviorTransient, this triggers a space switch due
to rdar://9037452 .

Note the status bubble can still be hidden implicitly in other ways. E.g.
Cmd+h, or miniaturizing the browser window.

Bug:  866760 ,  31821 
Change-Id: Iaf6220bf39bb62cb6002ebd372b96abb10db4f38
Reviewed-on: https://chromium-review.googlesource.com/1155274
Reviewed-by: Elly Fong-Jones <ellyjones@chromium.org>
Commit-Queue: Trent Apted <tapted@chromium.org>
Cr-Commit-Position: refs/heads/master@{#579564}
[modify] https://crrev.com/ed7b111010b7f64504b2e874d9f4f6d9db0021fd/chrome/browser/ui/views/status_bubble_views.cc
[modify] https://crrev.com/ed7b111010b7f64504b2e874d9f4f6d9db0021fd/chrome/browser/ui/views/status_bubble_views.h
[add] https://crrev.com/ed7b111010b7f64504b2e874d9f4f6d9db0021fd/chrome/browser/ui/views/status_bubble_views_browsertest.cc
[add] https://crrev.com/ed7b111010b7f64504b2e874d9f4f6d9db0021fd/chrome/browser/ui/views/status_bubble_views_browsertest_mac.h
[add] https://crrev.com/ed7b111010b7f64504b2e874d9f4f6d9db0021fd/chrome/browser/ui/views/status_bubble_views_browsertest_mac.mm
[modify] https://crrev.com/ed7b111010b7f64504b2e874d9f4f6d9db0021fd/chrome/test/BUILD.gn

NextAction: 2018-08-02
Pls request a merge to M69 once CL listed at #9 looks good in canary and safe to merge. Thank you.
Hm - this might not be totally fixed. I'll have to take another look.
The NextAction date has arrived: 2018-08-02
Re #11: Ok, pls request a merge to M69 when change is ready and safe to merge. If merge gets in latest by Monday 5:00 PM PT, we can take it in for next week Beta. Thank you.
OK - tracked it down. Remaining part of the fix is in https://chromium-review.googlesource.com/c/chromium/src/+/1161701
Project Member

Comment 16 by bugdroid1@chromium.org, Aug 3

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/080ba540e01fcba9b512209adb3622e7f95d3419

commit 080ba540e01fcba9b512209adb3622e7f95d3419
Author: Trent Apted <tapted@chromium.org>
Date: Fri Aug 03 21:40:59 2018

For ShowInactive(), skip -[NSWindow orderWindow:] on already-visible child windows.

ShowInactive() is usually used to make a hidden window visible without having it
also take key focus. It can also be used to raise an already-visible window
higher in the window stacking order (also without taking focus).

However, a quirk of AppKit is that calling orderWindow: will also trigger a
Space switch to the desktop containing that window, if Chrome is the active
application. Since we never want ShowInactive() to do that, and since child
windows can not control their stacking order, skip the call to orderWindow
for child windows, if the window is already visible.

Bug:  866760 
Change-Id: I984c2ce8b0cb1754ee68e0392524c64739253ab9
Reviewed-on: https://chromium-review.googlesource.com/1161701
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: Trent Apted <tapted@chromium.org>
Cr-Commit-Position: refs/heads/master@{#580659}
[modify] https://crrev.com/080ba540e01fcba9b512209adb3622e7f95d3419/ui/views/cocoa/bridged_native_widget.mm
[modify] https://crrev.com/080ba540e01fcba9b512209adb3622e7f95d3419/ui/views/widget/native_widget_mac_unittest.mm

Labels: Merge-Request-69
Tested 70.0.3513.0 and the problem is fully fixed. Requesting merge of r580659 and r579564 to m69 - this is a bad usability regression. Thanks!
Project Member

Comment 18 by sheriffbot@chromium.org, Aug 5

Labels: -Merge-Request-69 Merge-Review-69 Hotlist-Merge-Review
This bug requires manual review: M69 has already been promoted to the beta branch, so this requires manual review
Please contact the milestone owner if you have questions.
Owners: amineer@(Android), kariahda@(iOS), cindyb@(ChromeOS), govind@(Desktop)

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Labels: -Merge-Review-69 Merge-Approved-69
Approving merge to M69 branch 3497 for r580659 and r579564 based on comment #17. Please merge your change to M69 branch 3497 by 4:00 PM PT, Monday (08/06) so we can pick it up for next week M69 beta release. 

Pls mark bug as fixed if there is nothing else is pending after the merge. Thank you.
Project Member

Comment 20 by bugdroid1@chromium.org, Aug 6

Labels: -merge-approved-69 merge-merged-3497
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/36bc12507029ee2bbb811110a0b87defb87511bd

commit 36bc12507029ee2bbb811110a0b87defb87511bd
Author: Trent Apted <tapted@chromium.org>
Date: Mon Aug 06 00:19:36 2018

[merge-m69] MacViewsBrowser: Never orderOut: the status bubble, nor order it in again.

Doing so requires it to detached and re-attached as a child window of
the browser. Even though the status bubble has
NSWindowCollectionBehaviorTransient, this triggers a space switch due
to rdar://9037452 .

Note the status bubble can still be hidden implicitly in other ways. E.g.
Cmd+h, or miniaturizing the browser window.

TBR=tapted@chromium.org

(cherry picked from commit ed7b111010b7f64504b2e874d9f4f6d9db0021fd)

Bug:  866760 
Change-Id: Iaf6220bf39bb62cb6002ebd372b96abb10db4f38
Reviewed-on: https://chromium-review.googlesource.com/1155274
Reviewed-by: Elly Fong-Jones <ellyjones@chromium.org>
Commit-Queue: Trent Apted <tapted@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#579564}
Reviewed-on: https://chromium-review.googlesource.com/1163225
Reviewed-by: Trent Apted <tapted@chromium.org>
Cr-Commit-Position: refs/branch-heads/3497@{#405}
Cr-Branched-From: 271eaf50594eb818c9295dc78d364aea18c82ea8-refs/heads/master@{#576753}
[modify] https://crrev.com/36bc12507029ee2bbb811110a0b87defb87511bd/chrome/browser/ui/views/status_bubble_views.cc
[modify] https://crrev.com/36bc12507029ee2bbb811110a0b87defb87511bd/chrome/browser/ui/views/status_bubble_views.h
[add] https://crrev.com/36bc12507029ee2bbb811110a0b87defb87511bd/chrome/browser/ui/views/status_bubble_views_browsertest.cc
[add] https://crrev.com/36bc12507029ee2bbb811110a0b87defb87511bd/chrome/browser/ui/views/status_bubble_views_browsertest_mac.h
[add] https://crrev.com/36bc12507029ee2bbb811110a0b87defb87511bd/chrome/browser/ui/views/status_bubble_views_browsertest_mac.mm
[modify] https://crrev.com/36bc12507029ee2bbb811110a0b87defb87511bd/chrome/test/BUILD.gn

Project Member

Comment 21 by bugdroid1@chromium.org, Aug 6

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/7e30157cc29f3c44c557decfe6a2ec7924e615cc

commit 7e30157cc29f3c44c557decfe6a2ec7924e615cc
Author: Trent Apted <tapted@chromium.org>
Date: Mon Aug 06 00:21:45 2018

[merge-m69] For ShowInactive(), skip -[NSWindow orderWindow:] on already-visible child windows.

ShowInactive() is usually used to make a hidden window visible without having it
also take key focus. It can also be used to raise an already-visible window
higher in the window stacking order (also without taking focus).

However, a quirk of AppKit is that calling orderWindow: will also trigger a
Space switch to the desktop containing that window, if Chrome is the active
application. Since we never want ShowInactive() to do that, and since child
windows can not control their stacking order, skip the call to orderWindow
for child windows, if the window is already visible.

TBR=tapted@chromium.org

(cherry picked from commit 080ba540e01fcba9b512209adb3622e7f95d3419)

Bug:  866760 
Change-Id: I984c2ce8b0cb1754ee68e0392524c64739253ab9
Reviewed-on: https://chromium-review.googlesource.com/1161701
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: Trent Apted <tapted@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#580659}
Reviewed-on: https://chromium-review.googlesource.com/1163226
Reviewed-by: Trent Apted <tapted@chromium.org>
Cr-Commit-Position: refs/branch-heads/3497@{#406}
Cr-Branched-From: 271eaf50594eb818c9295dc78d364aea18c82ea8-refs/heads/master@{#576753}
[modify] https://crrev.com/7e30157cc29f3c44c557decfe6a2ec7924e615cc/ui/views/cocoa/bridged_native_widget.mm
[modify] https://crrev.com/7e30157cc29f3c44c557decfe6a2ec7924e615cc/ui/views/widget/native_widget_mac_unittest.mm

Status: Fixed (was: Started)
Cc: sdy@chromium.org
 Issue 869121  has been merged into this issue.
Possibly caused  bug 880966 .

Sign in to add a comment