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

Issue 653868 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Oct 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 3
Type: Bug



Sign in to add a comment

Pressing the mouse down anywhere on a notification brings Chrome to the front

Project Member Reported by sdy@chromium.org, Oct 7 2016

Issue description

Version: 55.0.2883.0
OS: macOS 10.11.6

What steps will reproduce the problem?
(1) Make a website show a notification (`var n = new Notification('foo')`)
(2) Send Chrome to the background (e.g. by switching to another app)
(3) Click the notification, or just press the mouse button down without releasing.

What is the expected output?
Pressing the mouse down shouldn't do anything. Clicking shouldn't do anything (I believe — let me know what you think) because clicking a notification doesn't bring its tab to the front anyway (right now, clicking a notification just brings Chrome to the front without switching to a particular window or tab).

If the page calls `window.focus()` from the notifications onclick handler, then Chrome *should* come to the front (and bring the tab/window to the front as it does now).

What do you see instead?
Pressing the mouse down on the "⨉" button doesn't bring Chrome to the front, but pressing the mouse button with the cursor over any other part of the notification does.
 
Note that we are switching to native notifications fairly soon (enable chrome://flags#enable-native-notifications so not sure how worth is fixing this in the old system.

Comment 2 by sdy@chromium.org, Oct 7 2016

Hmm, OK. I'm excited about that — I knew it was in progress but not how close. I think I have a fix (and it's fairly tiny) for the current system, so I want to land it in case anything delays the flip, if that sounds reasonable to you.
Ah yes, I just saw it in the other bug. Let's land the simple fix for now. It might even make M55 branch point..
MCPopupWindow used to be a NSPanel subclass but was changed to a NSWindow with this CL: https://chromium.googlesource.com/chromium/src/+/ba96ee71b35d61b5dfcecc01a5c5f1568ed001c8
Cc: rsesek@chromium.org

Comment 6 by sdy@chromium.org, Oct 7 2016

Urf, I'm not sure if you saw the bug or the CL, but that was going to be my fix:
https://codereview.chromium.org/2393323005/

Thanks, will check out that bug.
Project Member

Comment 7 by bugdroid1@chromium.org, Oct 11 2016

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

commit 629a5d065848adbac50931ae305a3d8597578e4d
Author: sdy <sdy@chromium.org>
Date: Tue Oct 11 19:10:32 2016

[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 

Review-Url: https://codereview.chromium.org/2393323005
Cr-Commit-Position: refs/heads/master@{#424505}

[modify] https://crrev.com/629a5d065848adbac50931ae305a3d8597578e4d/ui/message_center/cocoa/popup_controller.mm

Comment 8 by joh...@chromium.org, Oct 12 2016

Please make sure this doesn't regress issue 470830 (using the steps to reproduce from the original report). That issue was a problem for us in Jun 2015, but by Oct 2015 it had started working as expected without explanation. In hindsight, it seems likely that https://codereview.chromium.org/1275363004 is the reason it started working, and hence https://codereview.chromium.org/2393323005 seems likely to regress it.

If this patch does turn out to regress issue 470830, then https://codereview.chromium.org/1411243012 (which I had abandoned because it was no longer necessary) might fix the regression.

Comment 9 by sdy@chromium.org, Oct 13 2016

johnme@: Thanks for catching this, you're totally right. I just submitted a modified version of your CL, since things moved around: crrev.com/2420733002.

Comment 10 by sdy@chromium.org, Oct 13 2016

Status: Fixed (was: Started)
Cc: manoranj...@chromium.org dimu@chromium.org
+dimu@, do you have any idea why it applied "merge-merged-2892" label at #12?
Cc: anan...@chromium.org amineer@chromium.org
Cc: -amineer@chromium.org mmoss@chromium.org
Likely because someone tried to recreate the branch by hand - +mmoss@ / dimu@ should be able to comment on that, likely related to branch.py failures over the weekend.

Comment 16 by mmoss@chromium.org, Oct 17 2016

That's been the cause in the past, though I'm not aware of any attempt to recreate those failed branches, and this is exactly why I wanted to just bump to 2893, rather than trying to fix 2892. Maybe some random person was trying to be "helpful".

Comment 17 by sdy@chromium.org, Dec 16 2016

Labels: -Proj-MacQualityOfLife Hotlist-MacQualityOfLife
Labels: -Hotlist-MacQualityOfLife Hotlist-PlatformExcellence
Migrating to more generic platform label, so that it can be applied to other platforms (i.e. I love the idea).

Sign in to add a comment