|
|
Chromium Code Reviews|
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. |
DescriptionMacViews: 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 #
Messages
Total messages: 17 (10 generated)
Description was changed from ========== 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. Apart from MacViews, EventFlagsFromNSEventWithModifiers is currently used by the browser back button and (when DevTools is attached) the reload button. So will behave correctly after this change. BUG=616357 ========== to ========== 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. Apart from MacViews, EventFlagsFromNSEventWithModifiers is currently used by the browser back button and (when DevTools is attached) the reload button. So these will behave correctly after this change. BUG=616357 ==========
Description was changed from ========== 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. Apart from MacViews, EventFlagsFromNSEventWithModifiers is currently used by the browser back button and (when DevTools is attached) the reload button. So these will behave correctly after this change. BUG=616357 ========== to ========== 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. 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. 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 the modifiers, which aren't altered by this CL) so there's no behaviour change. The browser back button itself (a ClickHoldButtonCell) still doesn't respect Ctrl+LeftClick (http://crbug.com/616357). But that's orthogonal. BUG=616650 ==========
Description was changed from ========== 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. 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. 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 the modifiers, which aren't altered by this CL) so there's no behaviour change. The browser back button itself (a ClickHoldButtonCell) still doesn't respect Ctrl+LeftClick (http://crbug.com/616357). But that's orthogonal. BUG=616650 ========== to ========== 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. 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. 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 the modifiers, which aren'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 ==========
tapted@chromium.org changed reviewers: + thakis@chromium.org
Description was changed from ========== 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. 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. 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 the modifiers, which aren'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 ========== to ========== 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. 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. 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 the modifiers, which aren'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 ==========
Description was changed from ========== 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. 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. 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 the modifiers, which aren'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 ========== to ========== 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. 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 the modifiers, which aren'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 ==========
Hi Nico WDYT? Handling this at a low level seems to be the simplest approach.
Looks good, but: https://codereview.chromium.org/2025943003/diff/20001/ui/events/cocoa/events_... File ui/events/cocoa/events_mac_unittest.mm (right): https://codereview.chromium.org/2025943003/diff/20001/ui/events/cocoa/events_... ui/events/cocoa/events_mac_unittest.mm:159: EXPECT_EQ(EF_RIGHT_MOUSE_BUTTON | EF_CONTROL_DOWN, Ctrl-left probably should be right without ctrl (?)
Description was changed from ========== 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. 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 the modifiers, which aren'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 ========== to ========== 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 ==========
https://codereview.chromium.org/2025943003/diff/20001/ui/events/cocoa/events_... File ui/events/cocoa/events_mac_unittest.mm (right): https://codereview.chromium.org/2025943003/diff/20001/ui/events/cocoa/events_... 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: > Ctrl-left probably should be right without ctrl (?) Done. I couldn't decide which :). If it was Cmd, or Middle-Click there's questions around open disposition, but Ctrl-clicks on Mac seem to be exclusively for this right-click thing, so nothing thinks to check for ctrl.
lgtm
The CQ bit was checked by tapted@chromium.org
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
Message was sent while issue was closed.
Description was changed from ========== 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 ========== to ========== 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 ==========
Message was sent while issue was closed.
Committed patchset #3 (id:40001)
Message was sent while issue was closed.
Description was changed from ========== 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 ========== to ========== 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} ==========
Message was sent while issue was closed.
Patchset 3 (id:??) landed as https://crrev.com/44b884f03bc32c8e891e80122e07d51595dd4b73 Cr-Commit-Position: refs/heads/master@{#397606} |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
