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

Issue 1352043005: mus: Implement Window Server Capture

Created:
5 years, 3 months ago by Fady Samuel
Modified:
5 years, 1 month ago
Reviewers:
sky
CC:
chromium-reviews, qsr+mojo_chromium.org, viettrungluu+watch_chromium.org, yzshen+watch_chromium.org, abarth-chromium, Aaron Boodman, darin (slow to review), ben+mojo_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

mus: Implement Window Server Capture This CL implements an explicit capture API that will be used for popups. BUG=533161

Patch Set 1 #

Patch Set 2 : Added test #

Patch Set 3 : Added a test #

Total comments: 7

Patch Set 4 : Added ReleaseCapture #

Patch Set 5 : Work in progress: new capture plumbing #

Patch Set 6 : Fixed formatting + simple app test. TODO: Add EventDispatcher unittest #

Patch Set 7 : Added capture unit tests #

Total comments: 5
Unified diffs Side-by-side diffs Delta from patch set Stats (+374 lines, -10 lines) Patch
M components/mus/public/cpp/lib/in_flight_change.h View 1 2 3 4 1 chunk +3 lines, -1 line 0 comments Download
M components/mus/public/cpp/lib/window.cc View 1 2 3 4 1 chunk +10 lines, -0 lines 1 comment Download
M components/mus/public/cpp/lib/window_tree_client_impl.h View 1 2 3 4 2 chunks +3 lines, -0 lines 0 comments Download
M components/mus/public/cpp/lib/window_tree_client_impl.cc View 1 2 3 4 5 2 chunks +26 lines, -0 lines 0 comments Download
M components/mus/public/cpp/tests/test_window_tree.h View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M components/mus/public/cpp/tests/test_window_tree.cc View 1 2 3 4 5 1 chunk +4 lines, -0 lines 0 comments Download
M components/mus/public/cpp/window.h View 1 2 3 4 1 chunk +4 lines, -0 lines 1 comment Download
M components/mus/public/cpp/window_observer.h View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M components/mus/public/interfaces/window_tree.mojom View 1 2 3 4 2 chunks +9 lines, -0 lines 0 comments Download
M components/mus/ws/access_policy.h View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M components/mus/ws/default_access_policy.h View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M components/mus/ws/default_access_policy.cc View 1 2 3 4 5 1 chunk +5 lines, -0 lines 0 comments Download
M components/mus/ws/display_manager.h View 1 2 3 4 2 chunks +6 lines, -0 lines 0 comments Download
M components/mus/ws/display_manager.cc View 1 2 3 4 2 chunks +11 lines, -1 line 0 comments Download
M components/mus/ws/display_manager_delegate.h View 1 2 3 4 1 chunk +3 lines, -0 lines 0 comments Download
M components/mus/ws/event_dispatcher.h View 1 2 3 4 5 6 3 chunks +9 lines, -0 lines 0 comments Download
M components/mus/ws/event_dispatcher.cc View 1 2 3 4 5 6 3 chunks +41 lines, -8 lines 3 comments Download
M components/mus/ws/event_dispatcher_delegate.h View 1 2 3 4 5 6 1 chunk +2 lines, -0 lines 0 comments Download
M components/mus/ws/event_dispatcher_unittest.cc View 1 2 3 4 5 6 2 chunks +115 lines, -0 lines 0 comments Download
M components/mus/ws/operation.h View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M components/mus/ws/test_change_tracker.h View 1 2 3 4 2 chunks +2 lines, -0 lines 0 comments Download
M components/mus/ws/test_change_tracker.cc View 1 2 3 4 2 chunks +11 lines, -0 lines 0 comments Download
M components/mus/ws/window_manager_access_policy.h View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M components/mus/ws/window_manager_access_policy.cc View 1 2 3 4 1 chunk +5 lines, -0 lines 0 comments Download
M components/mus/ws/window_tree_apptest.cc View 1 2 3 4 5 2 chunks +23 lines, -0 lines 0 comments Download
M components/mus/ws/window_tree_host_impl.h View 1 2 3 4 5 6 4 chunks +12 lines, -0 lines 0 comments Download
M components/mus/ws/window_tree_host_impl.cc View 1 2 3 4 5 6 3 chunks +27 lines, -0 lines 0 comments Download
M components/mus/ws/window_tree_impl.h View 1 2 3 4 2 chunks +3 lines, -0 lines 0 comments Download
M components/mus/ws/window_tree_impl.cc View 1 2 3 4 5 2 chunks +29 lines, -0 lines 0 comments Download
M components/mus/ws/window_tree_unittest.cc View 1 2 3 4 2 chunks +3 lines, -0 lines 0 comments Download

Messages

Total messages: 12 (5 generated)
Fady Samuel
5 years, 3 months ago (2015-09-17 23:55:29 UTC) #2
sadrul
Both DisplayManager and View should have corresponding ReleaseCapture support as well. In the CL description: ...
5 years, 3 months ago (2015-09-18 01:30:50 UTC) #4
Fady Samuel
PTAL Sadrul. I added a ReleaseCapture. I'm not sure what to do about Capture across ...
5 years, 3 months ago (2015-09-18 02:44:43 UTC) #5
sadrul
https://codereview.chromium.org/1352043005/diff/40001/components/mus/view_tree_apptest.cc File components/mus/view_tree_apptest.cc (right): https://codereview.chromium.org/1352043005/diff/40001/components/mus/view_tree_apptest.cc#newcode1686 components/mus/view_tree_apptest.cc:1686: SetViewCapture(vm1(), view_1_2); On 2015/09/18 02:44:43, Fady Samuel wrote: > ...
5 years, 3 months ago (2015-09-18 11:47:29 UTC) #6
Fady Samuel
Hi Scott, I've reimplemented the explicit capture API and added a few tests. Could you ...
5 years, 1 month ago (2015-11-16 23:02:04 UTC) #10
sky
On Mon, Nov 16, 2015 at 3:02 PM, <fsamuel@chromium.org> wrote: > Hi Scott, > > ...
5 years, 1 month ago (2015-11-17 00:40:54 UTC) #11
sky
5 years, 1 month ago (2015-11-17 01:06:42 UTC) #12
I only made it part way through this. Some things to consider. The common case
is on first mouse button down we grab capture and release on last mouse button
up. Views code explicitly calls to set capture like this. The client lib should
track this, so that calls to setcapture/releasecapture during this time don't do
anything. Bad things could happen if we didn't have the client lib deal with
this. For example, consider a quick press/release. It's entirely possible for
the press/release to be processed before the client has received anything. If
the client does a SetCapture as well, and it makes it to the server, then the
client could end up getting some moves outside the bounds of the window that it
shouldn't. I'm thinking of this sequence:

mouse press
mouse release
move
move
move

It's conceivable this is processed (on the server) as:

mouse press
mouse release

setcapture
move
move
move


I think the client needs to know what the server is going to do. I also think
we'll need some way to opt out of the implicit release capture for certain
things (like menus).

https://codereview.chromium.org/1352043005/diff/120001/components/mus/public/...
File components/mus/public/cpp/lib/window.cc (right):

https://codereview.chromium.org/1352043005/diff/120001/components/mus/public/...
components/mus/public/cpp/lib/window.cc:381: if (connection_)
We should track capture locally too.

https://codereview.chromium.org/1352043005/diff/120001/components/mus/public/...
File components/mus/public/cpp/window.h (right):

https://codereview.chromium.org/1352043005/diff/120001/components/mus/public/...
components/mus/public/cpp/window.h:170: // Capture.
This comment isn't really useful, nuke it.

https://codereview.chromium.org/1352043005/diff/120001/components/mus/ws/even...
File components/mus/ws/event_dispatcher.cc (right):

https://codereview.chromium.org/1352043005/diff/120001/components/mus/ws/even...
components/mus/ws/event_dispatcher.cc:152: CancelAllPointerEvents();
If window is in pointer_targets_ won't this incorrectly remove it?

https://codereview.chromium.org/1352043005/diff/120001/components/mus/ws/even...
components/mus/ws/event_dispatcher.cc:286: if (capture_window_) {
Based on the name I wouldn't expect this to reset capture_window_ too.

https://codereview.chromium.org/1352043005/diff/120001/components/mus/ws/even...
components/mus/ws/event_dispatcher.cc:290: std::set<ServerWindow*>
pointer_targets;
The windows should see a cancel when this happens.

Powered by Google App Engine
This is Rietveld 408576698