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

Issue 2025943003: MacViews: Treat Ctrl+LeftClick as RightClick on Mac. (Closed)

Created:
4 years, 6 months ago by tapted
Modified:
4 years, 6 months ago
Reviewers:
Nico
CC:
chromium-reviews, tdresser+watch_chromium.org, chrome-apps-syd-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@20160520-Enums-MakeThemInt-HeaderChanges-ROLLUP
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

MacViews: Treat Ctrl+LeftClick as RightClick on Mac. Alters EventFlagsFromNSEventWithModifiers to check for Ctrl in the NSEvent modifierFlags and make a left click a right click. Removes the Ctrl modifier in such cases. Mac lets you disable "secondary click" completely in Trackpad settings, which leaves Ctrl+Click as the only way to "right"-click, so we should support this. There isn't a system setting that disables Ctrl+Click. Apart from MacViews, EventFlagsFromNSEventWithModifiers is currently used by the browser back button and (when DevTools is attached) the reload button, but only for feeding modifiers to ui::MenuModel::ActivatedAt(index, flags). They use ui::DispositionFromEventFlags(..) which only cares about middle-clicks (and -for Mac- the Command modifier, which isn't altered by this CL) so there's no behaviour change for Cocoa with this CL. The browser back button itself (a ClickHoldButtonCell) still doesn't respect Ctrl+LeftClick (http://crbug.com/616357). But that's orthogonal. BUG=616650 Committed: https://crrev.com/44b884f03bc32c8e891e80122e07d51595dd4b73 Cr-Commit-Position: refs/heads/master@{#397606}

Patch Set 1 #

Patch Set 2 : ugh depends patchset #

Total comments: 2

Patch Set 3 : Remove control flag #

Unified diffs Side-by-side diffs Delta from patch set Stats (+19 lines, -5 lines) Patch
M ui/events/cocoa/cocoa_event_utils.mm View 1 2 1 chunk +9 lines, -1 line 0 comments Download
M ui/events/cocoa/events_mac_unittest.mm View 1 2 2 chunks +10 lines, -4 lines 0 comments Download

Messages

Total messages: 17 (10 generated)
tapted
Hi Nico WDYT? Handling this at a low level seems to be the simplest approach.
4 years, 6 months ago (2016-06-02 04:51:06 UTC) #7
Nico
Looks good, but: https://codereview.chromium.org/2025943003/diff/20001/ui/events/cocoa/events_mac_unittest.mm File ui/events/cocoa/events_mac_unittest.mm (right): https://codereview.chromium.org/2025943003/diff/20001/ui/events/cocoa/events_mac_unittest.mm#newcode159 ui/events/cocoa/events_mac_unittest.mm:159: EXPECT_EQ(EF_RIGHT_MOUSE_BUTTON | EF_CONTROL_DOWN, Ctrl-left probably should ...
4 years, 6 months ago (2016-06-02 11:22:45 UTC) #8
tapted
https://codereview.chromium.org/2025943003/diff/20001/ui/events/cocoa/events_mac_unittest.mm File ui/events/cocoa/events_mac_unittest.mm (right): https://codereview.chromium.org/2025943003/diff/20001/ui/events/cocoa/events_mac_unittest.mm#newcode159 ui/events/cocoa/events_mac_unittest.mm:159: EXPECT_EQ(EF_RIGHT_MOUSE_BUTTON | EF_CONTROL_DOWN, On 2016/06/02 11:22:45, Nico wrote: > ...
4 years, 6 months ago (2016-06-03 01:25:05 UTC) #10
Nico
lgtm
4 years, 6 months ago (2016-06-03 01:30:16 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2025943003/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/2025943003/40001
4 years, 6 months ago (2016-06-03 01:32:48 UTC) #13
commit-bot: I haz the power
Committed patchset #3 (id:40001)
4 years, 6 months ago (2016-06-03 02:54:30 UTC) #15
commit-bot: I haz the power
4 years, 6 months ago (2016-06-03 02:56:34 UTC) #17
Message was sent while issue was closed.
Patchset 3 (id:??) landed as
https://crrev.com/44b884f03bc32c8e891e80122e07d51595dd4b73
Cr-Commit-Position: refs/heads/master@{#397606}

Powered by Google App Engine
This is Rietveld 408576698