Commit f999944b authored by reveman's avatar reveman Committed by Commit bot

exo: Fix sub surface input event support.

Return true from ShouldDescendIntoChildForEventHandling so
sub surface events are generated relative to the sub surface
rather than the top level shell surface.

BUG=549781
TEST=exo_unittests --gtest_filter=PointerTest.OnPointerMotion

Review URL: https://codereview.chromium.org/1641773004

Cr-Commit-Position: refs/heads/master@{#371913}
parent a5f65447
......@@ -106,6 +106,27 @@ TEST_F(PointerTest, OnPointerMotion) {
generator.MoveMouseTo(surface->GetBoundsInScreen().origin() +
gfx::Vector2d(1, 1));
scoped_ptr<Surface> sub_surface(new Surface);
surface->AddSubSurface(sub_surface.get());
surface->SetSubSurfacePosition(sub_surface.get(), gfx::Point(5, 5));
gfx::Size sub_buffer_size(5, 5);
scoped_ptr<Buffer> sub_buffer(
new Buffer(exo_test_helper()->CreateGpuMemoryBuffer(sub_buffer_size),
GL_TEXTURE_2D));
sub_surface->Attach(sub_buffer.get());
sub_surface->Commit();
surface->Commit();
EXPECT_CALL(delegate, CanAcceptPointerEventsForSurface(sub_surface.get()))
.WillRepeatedly(testing::Return(true));
EXPECT_CALL(delegate, OnPointerLeave(surface.get()));
EXPECT_CALL(delegate, OnPointerEnter(sub_surface.get(), gfx::Point(), 0));
generator.MoveMouseTo(sub_surface->GetBoundsInScreen().origin());
EXPECT_CALL(delegate, OnPointerMotion(testing::_, gfx::Point(1, 1)));
generator.MoveMouseTo(sub_surface->GetBoundsInScreen().origin() +
gfx::Vector2d(1, 1));
EXPECT_CALL(delegate, OnPointerDestroying(pointer.get()));
pointer.reset();
}
......
......@@ -70,7 +70,7 @@ class EmptyWindowDelegate : public aura::WindowDelegate {
bool ShouldDescendIntoChildForEventHandling(
aura::Window* child,
const gfx::Point& location) override {
return false;
return true;
}
bool CanFocus() override { return true; }
void OnCaptureLost() override {}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment