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

Issue 2548513002: Update bool WindowManager::OnWmSetBounds() to match with its desirable behavior. (Closed)

Created:
4 years ago by thanhph
Modified:
3 years, 5 months ago
Reviewers:
sky, mfomitchev
CC:
chromium-reviews, rjkroege
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Update bool WindowManager::OnWmSetBounds() to match with its desirable behavior. Function WindowManagerDelegate::OnWmSetBounds should have no return value, take a const gfx::Rect& bounds and let the client set whatever bounds it wants on the window. WindowTreeClient::WmSetBounds would call WmResponse with false always. Doing this means the WindowManagerDelegate can set whatever bounds it wants, and by supplying false to WmResponse we ensure the client fallsback to the most recent value from the server, which is either the original bounds (if the delegate didn't change anything) or the bounds the delegate changed the window too (which may be the supplied bounds). BUG=672151

Patch Set 1 #

Patch Set 2 : Revert if condition. #

Patch Set 3 : Fix app-list launcher crash when screen size is small (i.e 800x800) #

Patch Set 4 : Make sure OnWmSetBounds is a void function. #

Patch Set 5 : Change bool to void function. #

Patch Set 6 : change bool to void function. #

Patch Set 7 : change bool to void. #

Total comments: 4

Patch Set 8 : Try to figure why unit test WindowServerTest.SetBoundsSecurit is failling. #

Patch Set 9 : Try to check if unittest WindowServerTest.SetBoundsSecurity is deterministic. #

Patch Set 10 : Change function void to bool. #

Patch Set 11 : Fix conflict after git pull #

Patch Set 12 : Change bool to void. #

Patch Set 13 : revert ui::window to aura::window. #

Total comments: 12

Patch Set 14 : Change function bool WindowManager::OnWmSetBounds to return void and update window's bounds in WM w… #

Patch Set 15 : Change gfx::Rect* to const gfx::Rect&. #

Total comments: 14

Patch Set 16 : Debug attempt. #

Patch Set 17 : Remove if condition statetment in Window::SetBounds(const gfx::Rect& new_bounds). #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+38 lines, -71 lines) Patch
M ash/mus/window_manager.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +1 line, -1 line 0 comments Download
M ash/mus/window_manager.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +3 lines, -6 lines 0 comments Download
M mash/simple_wm/simple_wm.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +1 line, -1 line 0 comments Download
M mash/simple_wm/simple_wm.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +2 lines, -3 lines 0 comments Download
M services/ui/demo/mus_demo.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +1 line, -1 line 0 comments Download
M services/ui/demo/mus_demo.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +1 line, -3 lines 0 comments Download
M services/ui/public/cpp/tests/window_server_test_base.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +1 line, -1 line 0 comments Download
M services/ui/public/cpp/tests/window_server_test_base.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +2 lines, -5 lines 0 comments Download
M services/ui/public/cpp/window_manager_delegate.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +2 lines, -6 lines 1 comment Download
M services/ui/public/cpp/window_tree_client.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +5 lines, -10 lines 1 comment Download
M services/ui/test_wm/test_wm.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +1 line, -3 lines 0 comments Download
M services/ui/ws/window_manager_client_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +1 line, -3 lines 0 comments Download
M ui/aura/mus/window_manager_delegate.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +1 line, -1 line 0 comments Download
M ui/aura/mus/window_tree_client.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +6 lines, -11 lines 1 comment Download
M ui/aura/test/aura_test_base.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +1 line, -1 line 0 comments Download
M ui/aura/test/aura_test_base.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +1 line, -3 lines 0 comments Download
M ui/aura/window.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +8 lines, -12 lines 1 comment Download

Messages

Total messages: 73 (53 generated)
Fady Samuel
https://codereview.chromium.org/2548513002/diff/120001/services/ui/public/cpp/tests/window_server_test_base.cc File services/ui/public/cpp/tests/window_server_test_base.cc (right): https://codereview.chromium.org/2548513002/diff/120001/services/ui/public/cpp/tests/window_server_test_base.cc#newcode121 services/ui/public/cpp/tests/window_server_test_base.cc:121: void WindowServerTestBase::OnWmSetBounds(Window* window, gfx::Rect* bounds) {} This is changing ...
4 years ago (2016-12-02 23:18:25 UTC) #26
thanhph
Hi Fady, still failing on WindowServerTest.SetBoundsSecurity. I'll debug it more in a bit. Thanks! Thanh. ...
4 years ago (2016-12-05 17:54:00 UTC) #28
thanhph
sky, mfomitchev: Please review changes in I get the patch to pass all the test ...
4 years ago (2016-12-06 20:07:46 UTC) #45
thanhph
On 2016/12/06 20:07:46, thanhph wrote: > sky, mfomitchev: Please review changes in > > I ...
4 years ago (2016-12-06 20:12:37 UTC) #47
Fady Samuel
https://codereview.chromium.org/2548513002/diff/240001/services/ui/public/cpp/window_tree_client.cc File services/ui/public/cpp/window_tree_client.cc (right): https://codereview.chromium.org/2548513002/diff/240001/services/ui/public/cpp/window_tree_client.cc#newcode1326 services/ui/public/cpp/window_tree_client.cc:1326: window_manager_internal_client_->WmResponse(change_id, false); I'm confused about this? Shouldn't the second ...
4 years ago (2016-12-06 20:50:08 UTC) #48
mfomitchev
https://codereview.chromium.org/2548513002/diff/240001/services/ui/public/cpp/window_tree_client.cc File services/ui/public/cpp/window_tree_client.cc (right): https://codereview.chromium.org/2548513002/diff/240001/services/ui/public/cpp/window_tree_client.cc#newcode1323 services/ui/public/cpp/window_tree_client.cc:1323: window->SetBounds(transit_bounds_in_dip); Don't we still need to call window_manager_delegate_->OnWmSetBounds(window, &bounds) ...
4 years ago (2016-12-06 20:55:20 UTC) #49
mfomitchev
https://codereview.chromium.org/2548513002/diff/240001/services/ui/public/cpp/window_tree_client.cc File services/ui/public/cpp/window_tree_client.cc (right): https://codereview.chromium.org/2548513002/diff/240001/services/ui/public/cpp/window_tree_client.cc#newcode1326 services/ui/public/cpp/window_tree_client.cc:1326: window_manager_internal_client_->WmResponse(change_id, false); On 2016/12/06 20:50:07, Fady Samuel wrote: > ...
4 years ago (2016-12-06 20:57:44 UTC) #50
thanhph
https://codereview.chromium.org/2548513002/diff/240001/services/ui/public/cpp/window_tree_client.cc File services/ui/public/cpp/window_tree_client.cc (right): https://codereview.chromium.org/2548513002/diff/240001/services/ui/public/cpp/window_tree_client.cc#newcode1323 services/ui/public/cpp/window_tree_client.cc:1323: window->SetBounds(transit_bounds_in_dip); On 2016/12/06 20:55:20, mfomitchev wrote: > Don't we ...
4 years ago (2016-12-06 21:41:05 UTC) #51
mfomitchev
https://codereview.chromium.org/2548513002/diff/240001/services/ui/public/cpp/window_tree_client.cc File services/ui/public/cpp/window_tree_client.cc (right): https://codereview.chromium.org/2548513002/diff/240001/services/ui/public/cpp/window_tree_client.cc#newcode1323 services/ui/public/cpp/window_tree_client.cc:1323: window->SetBounds(transit_bounds_in_dip); On 2016/12/06 21:41:04, thanhph wrote: > On 2016/12/06 ...
4 years ago (2016-12-06 21:57:11 UTC) #52
mfomitchev
I suspect the problem here is that InFlightBoundsChange::Revert() is reverting the change which was made ...
4 years ago (2016-12-06 22:11:35 UTC) #53
sky
On 2016/12/06 22:11:35, mfomitchev wrote: > I suspect the problem here is that InFlightBoundsChange::Revert() is ...
4 years ago (2016-12-06 23:14:52 UTC) #54
chromium-reviews
Ah, I see, thanks. We'll dig more into this then. On Tue, Dec 6, 2016 ...
4 years ago (2016-12-06 23:34:25 UTC) #55
thanhph
On 2016/12/06 23:34:25, chromium-reviews wrote: > Ah, I see, thanks. We'll dig more into this ...
4 years ago (2016-12-07 17:36:20 UTC) #56
sky
As you have all this fresh in your head I would do the change now. ...
4 years ago (2016-12-07 18:07:55 UTC) #57
thanhph
Thanks for the comments and discussions. I have uploaded the new cl addressing function WindowManager::OnWmSetBounds(),i.e, ...
4 years ago (2016-12-07 20:48:12 UTC) #63
mfomitchev
Can you please update the CL description similar to how you updated the bug?
4 years ago (2016-12-07 20:52:48 UTC) #65
thanhph
On 2016/12/07 20:52:48, mfomitchev wrote: > Can you please update the CL description similar to ...
4 years ago (2016-12-07 20:55:23 UTC) #68
mfomitchev
https://codereview.chromium.org/2548513002/diff/280001/mash/simple_wm/simple_wm.cc File mash/simple_wm/simple_wm.cc (right): https://codereview.chromium.org/2548513002/diff/280001/mash/simple_wm/simple_wm.cc#newcode141 mash/simple_wm/simple_wm.cc:141: void SimpleWM::OnWmSetBounds(aura::Window* window, gfx::Rect* bounds) { Update the signature. ...
4 years ago (2016-12-07 20:59:46 UTC) #69
thanhph
https://codereview.chromium.org/2548513002/diff/280001/mash/simple_wm/simple_wm.cc File mash/simple_wm/simple_wm.cc (right): https://codereview.chromium.org/2548513002/diff/280001/mash/simple_wm/simple_wm.cc#newcode141 mash/simple_wm/simple_wm.cc:141: void SimpleWM::OnWmSetBounds(aura::Window* window, gfx::Rect* bounds) { On 2016/12/07 20:59:46, ...
4 years ago (2016-12-08 00:20:29 UTC) #72
mfomitchev
4 years ago (2016-12-08 20:44:23 UTC) #73
As discussed, you should probably sit on the CL until chrome switches to use
Aura Mus, but some comments nevertheless.

https://codereview.chromium.org/2548513002/diff/280001/mash/simple_wm/simple_...
File mash/simple_wm/simple_wm.cc (right):

https://codereview.chromium.org/2548513002/diff/280001/mash/simple_wm/simple_...
mash/simple_wm/simple_wm.cc:141: void SimpleWM::OnWmSetBounds(aura::Window*
window, gfx::Rect* bounds) {
On 2016/12/08 00:20:29, thanhph wrote:
> On 2016/12/07 20:59:46, mfomitchev wrote:
> > Update the signature.
> 
> Done.

See also my other comment above - I think we need to set the bounds on the
window (in all WM impls, not just here), since the client lib is no longer doing
it.

https://codereview.chromium.org/2548513002/diff/320001/services/ui/public/cpp...
File services/ui/public/cpp/window_manager_delegate.h (right):

https://codereview.chromium.org/2548513002/diff/320001/services/ui/public/cpp...
services/ui/public/cpp/window_manager_delegate.h:73: // Set window bounds.
Please elaborate on what this is actually supposed to do.

https://codereview.chromium.org/2548513002/diff/320001/services/ui/public/cpp...
File services/ui/public/cpp/window_tree_client.cc (right):

https://codereview.chromium.org/2548513002/diff/320001/services/ui/public/cpp...
services/ui/public/cpp/window_tree_client.cc:1326: // Returning false ensures
the client applies the bounds we set above in the
"the bounds which the |window_manager_delegate_| sets."

https://codereview.chromium.org/2548513002/diff/320001/ui/aura/mus/window_tre...
File ui/aura/mus/window_tree_client.cc (right):

https://codereview.chromium.org/2548513002/diff/320001/ui/aura/mus/window_tre...
ui/aura/mus/window_tree_client.cc:1313: // delegate.
Ditto

https://codereview.chromium.org/2548513002/diff/320001/ui/aura/window.cc
File ui/aura/window.cc (left):

https://codereview.chromium.org/2548513002/diff/320001/ui/aura/window.cc#oldc...
ui/aura/window.cc:296: if (parent_ && parent_->layout_manager())
Please put this back

Powered by Google App Engine
This is Rietveld 408576698