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

Issue 2475173002: MacViews: Fix window dragging on Sierra. (Closed)

Created:
4 years, 1 month ago by karandeepb
Modified:
4 years, 1 month ago
Reviewers:
tapted
CC:
chromium-reviews, tfarina, mac-reviews_chromium.org, chrome-apps-syd-reviews_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

MacViews: Fix window dragging on Sierra. To allow window dragging on custom window regions on MacViews, an event monitor is currently used. The event monitor looks for any mouse down events which should cause window dragging, makes the window draggable and then reposts these events. Since AppKit caches the draggable regions, we use a hack to invalidate this cache in BridgedNativeWidget::SetDraggable. However, this broke on Sierra. To fix, use the new window dragging API [NSWindow performWindowDragWithEvent:] introduced in Mac OS 10.11. BridgedNativeWidget::ShouldUseDragEventMonitor is introduced which returns true if the drag event monitor approach should be used when the API is not available. NativeWidgetMacNSWindow's sendEvent is modified to intercept mouse events and perform window dragging when necessary. Also, BridgedNativeWidgetUITest.HitTest is fixed for both the cases (when a drag event monitor is used and when it isn't). BUG=660270 TEST=On Sierra, enable chrome://flags/#mac-views-native-app-windows. Install https://chrome.google.com/webstore/detail/frameless-window-sample/hjjdaddngnaofnfjpajdcbdmkegiakec/. Add a titlebar (draggable region) and ensure window dragging works. TEST=Build with mac_views_browser=true on Sierra. Ensure the browser window is draggable. Committed: https://crrev.com/d22dbe7d44e81b40c2c1415a13ff7965693150ed Cr-Commit-Position: refs/heads/master@{#431166}

Patch Set 1 : -- #

Patch Set 2 : Tests #

Total comments: 16

Patch Set 3 : Address comments. #

Total comments: 3

Patch Set 4 : Address comments. #

Patch Set 5 : Rebase. Update comment. #include=>#import. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+180 lines, -76 lines) Patch
M base/mac/sdk_forward_declarations.h View 1 2 3 4 1 chunk +4 lines, -0 lines 0 comments Download
M ui/views/cocoa/bridged_native_widget.h View 2 chunks +13 lines, -5 lines 0 comments Download
M ui/views/cocoa/bridged_native_widget.mm View 1 2 3 4 8 chunks +59 lines, -28 lines 0 comments Download
M ui/views/cocoa/bridged_native_widget_interactive_uitest.mm View 1 2 3 4 9 chunks +82 lines, -29 lines 0 comments Download
M ui/views/cocoa/native_widget_mac_nswindow.mm View 1 2 3 4 2 chunks +22 lines, -3 lines 0 comments Download
M ui/views/cocoa/views_nswindow_delegate.h View 1 chunk +0 lines, -7 lines 0 comments Download
M ui/views/cocoa/views_nswindow_delegate.mm View 2 3 4 1 chunk +0 lines, -4 lines 0 comments Download

Messages

Total messages: 38 (25 generated)
karandeepb
Can you give this a quick look Trent. Will try to add a test. There's ...
4 years, 1 month ago (2016-11-04 04:17:09 UTC) #9
tapted
looks pretty neat - nothing really stood out https://codereview.chromium.org/2475173002/diff/140001/ui/views/cocoa/native_widget_mac_nswindow.mm File ui/views/cocoa/native_widget_mac_nswindow.mm (right): https://codereview.chromium.org/2475173002/diff/140001/ui/views/cocoa/native_widget_mac_nswindow.mm#newcode124 ui/views/cocoa/native_widget_mac_nswindow.mm:124: DCHECK(bridge); ...
4 years, 1 month ago (2016-11-04 04:58:54 UTC) #10
karandeepb
On 2016/11/04 04:58:54, tapted wrote: > looks pretty neat - nothing really stood out > ...
4 years, 1 month ago (2016-11-08 02:58:46 UTC) #22
karandeepb
PTAL Trent. https://codereview.chromium.org/2475173002/diff/300001/ui/views/cocoa/bridged_native_widget_interactive_uitest.mm File ui/views/cocoa/bridged_native_widget_interactive_uitest.mm (right): https://codereview.chromium.org/2475173002/diff/300001/ui/views/cocoa/bridged_native_widget_interactive_uitest.mm#newcode339 ui/views/cocoa/bridged_native_widget_interactive_uitest.mm:339: [window setIgnoresMouseEvents:NO]; What would be a good ...
4 years, 1 month ago (2016-11-08 02:59:03 UTC) #23
tapted
https://codereview.chromium.org/2475173002/diff/300001/ui/views/cocoa/bridged_native_widget.mm File ui/views/cocoa/bridged_native_widget.mm (right): https://codereview.chromium.org/2475173002/diff/300001/ui/views/cocoa/bridged_native_widget.mm#newcode908 ui/views/cocoa/bridged_native_widget.mm:908: HTCAPTION) { nit: no curlies https://codereview.chromium.org/2475173002/diff/300001/ui/views/cocoa/bridged_native_widget.mm#newcode918 ui/views/cocoa/bridged_native_widget.mm:918: NSPointInRect(location_in_window, [subview ...
4 years, 1 month ago (2016-11-08 05:03:17 UTC) #24
karandeepb
PTAL Trent. I am not really sure about the test though. It hangs/flakes for me ...
4 years, 1 month ago (2016-11-09 04:44:20 UTC) #26
tapted
https://codereview.chromium.org/2475173002/diff/300001/ui/views/cocoa/bridged_native_widget_interactive_uitest.mm File ui/views/cocoa/bridged_native_widget_interactive_uitest.mm (right): https://codereview.chromium.org/2475173002/diff/300001/ui/views/cocoa/bridged_native_widget_interactive_uitest.mm#newcode339 ui/views/cocoa/bridged_native_widget_interactive_uitest.mm:339: [window setIgnoresMouseEvents:NO]; On 2016/11/09 04:44:20, karandeepb wrote: > On ...
4 years, 1 month ago (2016-11-09 05:06:56 UTC) #27
karandeepb
PTAL Trent. https://codereview.chromium.org/2475173002/diff/300001/ui/views/cocoa/bridged_native_widget_interactive_uitest.mm File ui/views/cocoa/bridged_native_widget_interactive_uitest.mm (right): https://codereview.chromium.org/2475173002/diff/300001/ui/views/cocoa/bridged_native_widget_interactive_uitest.mm#newcode339 ui/views/cocoa/bridged_native_widget_interactive_uitest.mm:339: [window setIgnoresMouseEvents:NO]; >>yah - OSX uses the ...
4 years, 1 month ago (2016-11-09 06:33:22 UTC) #28
tapted
lgtm https://codereview.chromium.org/2475173002/diff/300001/ui/views/cocoa/bridged_native_widget_interactive_uitest.mm File ui/views/cocoa/bridged_native_widget_interactive_uitest.mm (right): https://codereview.chromium.org/2475173002/diff/300001/ui/views/cocoa/bridged_native_widget_interactive_uitest.mm#newcode339 ui/views/cocoa/bridged_native_widget_interactive_uitest.mm:339: [window setIgnoresMouseEvents:NO]; On 2016/11/09 06:33:22, karandeepb wrote: > ...
4 years, 1 month ago (2016-11-10 00:43:20 UTC) #29
karandeepb
https://codereview.chromium.org/2475173002/diff/300001/ui/views/cocoa/bridged_native_widget_interactive_uitest.mm File ui/views/cocoa/bridged_native_widget_interactive_uitest.mm (right): https://codereview.chromium.org/2475173002/diff/300001/ui/views/cocoa/bridged_native_widget_interactive_uitest.mm#newcode339 ui/views/cocoa/bridged_native_widget_interactive_uitest.mm:339: [window setIgnoresMouseEvents:NO]; On 2016/11/10 00:43:20, tapted wrote: > On ...
4 years, 1 month ago (2016-11-10 02:44:43 UTC) #31
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/2475173002/400001
4 years, 1 month ago (2016-11-10 02:45:34 UTC) #34
commit-bot: I haz the power
Committed patchset #5 (id:400001)
4 years, 1 month ago (2016-11-10 03:24:23 UTC) #36
commit-bot: I haz the power
4 years, 1 month ago (2016-11-10 03:27:22 UTC) #38
Message was sent while issue was closed.
Patchset 5 (id:??) landed as
https://crrev.com/d22dbe7d44e81b40c2c1415a13ff7965693150ed
Cr-Commit-Position: refs/heads/master@{#431166}

Powered by Google App Engine
This is Rietveld 408576698