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

Issue 831643004: MacViews: Fix child window z-order and SetBounds (Closed)

Created:
5 years, 11 months ago by tapted
Modified:
5 years, 11 months ago
Reviewers:
Robert Sesek, sky
CC:
chromium-reviews, tfarina, chrome-apps-syd-reviews_chromium.org, mac-views-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

MacViews: Fix child window z-order and SetBounds The search box in the app list is a child views::Widget (so that it can animate over WebContents). Its position and z-order were broken on MacViews. The z-order issue boils down to a quirk in Cocoa where it is unable to correctly process a call to -[NSWindow orderWindow:relativeTo:] that is made in response to a visibility change in the same iteration over the event loop. To fix, make use of -[NSWindow addChildWindow:]. However, we must work around the issues it has. Specifically, it falls apart when we want to have hidden windows: Adding a child window always shows it, and hiding a child window detaches it. To fix that, child windows are removed from -[NSWindow childWindows] when ordered out and added back when the NSWindow becomes visible again. Then, to ensure visibility changes not initiated by BridgedNativeWidget::SetVisibilityState() correctly manage these children, calls to NotifyVisibilityChangeDown() are moved to a single call in OnVisibilityChangedTo(), called from the NSWindowDelegate after the visibility change is fed through to Cocoa. The x/y position bug was simpler. Mac was just missing the logic in aura::Window::SetBoundsInternal() that offsets the bounds when there is a parent. Cross-platform regression tests are added for these. The app_list_unittest AppListViewTestDesktopInstance/AppListViewTestDesktop.SearchResultsTest/2 also passes after this on MacViews. BUG=378134, 365977 Committed: https://crrev.com/1d11217e72c14e3515a01c016a280dac7e1deb21 Cr-Commit-Position: refs/heads/master@{#310647}

Patch Set 1 #

Patch Set 2 : fix linux; #

Patch Set 3 : Ditch RunPendingMessages - not needed - and add a hide-show test #

Patch Set 4 : Simplify a bit now we no longer try to do our own zorder management #

Patch Set 5 : ShowInactive for a more compelling test #

Total comments: 2

Patch Set 6 : fix typo: than->that #

Total comments: 2

Patch Set 7 : rebase maybe #

Patch Set 8 : CHECK->EXPECT_TRUE #

Unified diffs Side-by-side diffs Delta from patch set Stats (+199 lines, -13 lines) Patch
M ui/views/cocoa/bridged_native_widget.mm View 1 2 3 4 5 6 6 chunks +41 lines, -13 lines 0 comments Download
M ui/views/test/widget_test.h View 1 1 chunk +4 lines, -0 lines 0 comments Download
M ui/views/test/widget_test_aura.cc View 1 2 3 4 5 6 7 2 chunks +44 lines, -0 lines 0 comments Download
M ui/views/test/widget_test_mac.mm View 1 2 3 4 5 6 7 1 chunk +19 lines, -0 lines 0 comments Download
M ui/views/widget/widget_unittest.cc View 1 2 3 4 5 6 1 chunk +91 lines, -0 lines 0 comments Download

Messages

Total messages: 20 (9 generated)
tapted
Hi Robert - please take a look. Lots of failed attempts to get here.. Not ...
5 years, 11 months ago (2015-01-06 10:03:20 UTC) #6
Robert Sesek
LGTM. This child window business is getting quite subtle. https://codereview.chromium.org/831643004/diff/160001/ui/views/test/widget_test_aura.cc File ui/views/test/widget_test_aura.cc (right): https://codereview.chromium.org/831643004/diff/160001/ui/views/test/widget_test_aura.cc#newcode21 ui/views/test/widget_test_aura.cc:21: ...
5 years, 11 months ago (2015-01-07 00:11:40 UTC) #7
tapted
+sky for widget_unittest and widget_test{.h,aura,etc.} OWNERS and in case you know a better approach for ...
5 years, 11 months ago (2015-01-07 01:44:12 UTC) #8
tapted
(+sky) Whoops it would help if I actually added sky to reviewers... ಠ_ಠ (+sky for ...
5 years, 11 months ago (2015-01-08 03:13:19 UTC) #10
sky
LGTM https://codereview.chromium.org/831643004/diff/180001/ui/views/test/widget_test_aura.cc File ui/views/test/widget_test_aura.cc (right): https://codereview.chromium.org/831643004/diff/180001/ui/views/test/widget_test_aura.cc#newcode57 ui/views/test/widget_test_aura.cc:57: CHECK(above->IsVisible()); CHECKs aren't good for tests. If it ...
5 years, 11 months ago (2015-01-08 04:17:44 UTC) #11
tapted
https://codereview.chromium.org/831643004/diff/180001/ui/views/test/widget_test_aura.cc File ui/views/test/widget_test_aura.cc (right): https://codereview.chromium.org/831643004/diff/180001/ui/views/test/widget_test_aura.cc#newcode57 ui/views/test/widget_test_aura.cc:57: CHECK(above->IsVisible()); On 2015/01/08 04:17:44, sky wrote: > CHECKs aren't ...
5 years, 11 months ago (2015-01-08 09:07:56 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/831643004/220001
5 years, 11 months ago (2015-01-08 09:08:46 UTC) #14
commit-bot: I haz the power
Exceeded time limit waiting for builds to trigger.
5 years, 11 months ago (2015-01-08 11:10:31 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/831643004/220001
5 years, 11 months ago (2015-01-08 23:44:39 UTC) #18
commit-bot: I haz the power
Committed patchset #8 (id:220001)
5 years, 11 months ago (2015-01-09 01:04:02 UTC) #19
commit-bot: I haz the power
5 years, 11 months ago (2015-01-09 01:06:29 UTC) #20
Message was sent while issue was closed.
Patchset 8 (id:??) landed as
https://crrev.com/1d11217e72c14e3515a01c016a280dac7e1deb21
Cr-Commit-Position: refs/heads/master@{#310647}

Powered by Google App Engine
This is Rietveld 408576698