Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(283)

Issue 2393323005: [Mac] Use a nonactivating panel for notifications so that mouse down doesn't activate Chrome. (Closed)

Created:
4 years, 2 months ago by Sidney San Martín
Modified:
4 years, 2 months ago
CC:
chromium-reviews, Peter Beverloo, mlamouri+watch-notifications_chromium.org, awdf+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[Mac] Use a nonactivating panel for notifications so that mouse down doesn't activate Chrome. Currently, pressing the mouse button over a notification brings Chrome to the front, even though the tab which sent the notification won't be shown unless it calls `window.focus()` from its onclick listener. This CL switches notifications to use NSPanel, which can receive mouse events without activating the application. Notifications were previously switched away from NSPanel to work around crbug.com/459306. I tried fairly hard to repro that issue with this CL, and couldn't. If it comes back, I feel okay about reverting this change or taking another crack at its root cause. BUG=653868 Committed: https://crrev.com/629a5d065848adbac50931ae305a3d8597578e4d Cr-Commit-Position: refs/heads/master@{#424505}

Patch Set 1 #

Patch Set 2 : Use the old constant, the new one isn't in our current SDK #

Patch Set 3 : Rebase #

Patch Set 4 : Make notifications visible on all spaces, change a couple of flags to be appropriate for NSPanel #

Patch Set 5 : Actually, let's move "show on all spaces" into a separate CL #

Patch Set 6 : Rebase #

Patch Set 7 : Rebase #

Patch Set 8 : Make dependent on bugfix CL #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+8 lines, -12 lines) Patch
M ui/message_center/cocoa/popup_controller.mm View 1 2 3 4 5 2 chunks +8 lines, -12 lines 1 comment Download

Depends on Patchset:

Messages

Total messages: 18 (8 generated)
Sidney San Martín
avi@ for OWNERship, tapted@ and rsesek@ for sanity because I'm removing a workaround :).
4 years, 2 months ago (2016-10-07 21:51:45 UTC) #4
Avi (use Gerrit)
Good luck? 😬 LGTM
4 years, 2 months ago (2016-10-07 22:02:18 UTC) #5
tapted
it's only packaged apps that are deprecated (and not on ChromeOS, and not on other ...
4 years, 2 months ago (2016-10-10 03:13:25 UTC) #6
Sidney San Martín
On 2016/10/10 03:13:25, tapted wrote: > it's only packaged apps that are deprecated (and not ...
4 years, 2 months ago (2016-10-10 16:48:35 UTC) #7
tapted
lgtm with an updated CL description https://codereview.chromium.org/2393323005/diff/160001/ui/message_center/cocoa/popup_controller.mm File ui/message_center/cocoa/popup_controller.mm (right): https://codereview.chromium.org/2393323005/diff/160001/ui/message_center/cocoa/popup_controller.mm#newcode115 ui/message_center/cocoa/popup_controller.mm:115: [window setBecomesKeyOnlyIfNeeded:YES]; ah-ha! ...
4 years, 2 months ago (2016-10-11 03:55:44 UTC) #8
Avi (use Gerrit)
On 2016/10/11 03:55:44, tapted wrote: > I'm > pretty sure we don't put textfields in ...
4 years, 2 months ago (2016-10-11 15:15:29 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2393323005/160001
4 years, 2 months ago (2016-10-11 18:15:51 UTC) #13
commit-bot: I haz the power
Committed patchset #8 (id:160001)
4 years, 2 months ago (2016-10-11 19:10:58 UTC) #15
commit-bot: I haz the power
Patchset 8 (id:??) landed as https://crrev.com/629a5d065848adbac50931ae305a3d8597578e4d Cr-Commit-Position: refs/heads/master@{#424505}
4 years, 2 months ago (2016-10-11 19:13:27 UTC) #17
tapted
4 years, 2 months ago (2016-10-11 22:33:16 UTC) #18
Message was sent while issue was closed.
On 2016/10/11 15:15:29, Avi wrote:
> On 2016/10/11 03:55:44, tapted wrote:
> > I'm
> > pretty sure we don't put textfields in - but we _do_ have buttons. However,
> said
> > buttons are not keyboard accessible.
> 
> How does turning Full Keyboard Access on
> (https://support.apple.com/en-us/HT204434#fullkeyboard) affect your analysis?

Nah - I did try that. The issue for keyboard access is that these popups return
`NO` from canBecomeKeyWindow. That combined with NSNonactivatingPanelMask
(documented as "The panel
can receive keyboard input without activating the owning application.") seemed
to be the trigger for the nasty two-windows-have-key-state bug. But, if you also
pile setBecomesKeyOnlyIfNeeded:YES on top of that, then the main repro case no
longer reproduces (when I tried it on 10.11 at least).

Note there was still an obscure repro that I never fixed --
http://crbug.com/595926 -- but it had nothing to do with notifications (and is
probably triggered by one of the special weird things we do for apps).

Powered by Google App Engine
This is Rietveld 408576698