Commit 994cf0d8 authored by Tom Anderson's avatar Tom Anderson Committed by Chromium LUCI CQ

[XProto] Select expose events on EGL child windows

After [1], Chrome and ANGLE use separate X11 connections, so in order
for Chrome to receive exposure events, it must select for them its own
connection.

[1] https://chromium-review.googlesource.com/c/chromium/src/+/2492177

Change-Id: If01cd9d106bf900a5c7a56768602b34dc50b1a23
Bug: 1158170
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2602441
Commit-Queue: Thomas Anderson <thomasanderson@chromium.org>
Commit-Queue: Zhenyao Mo <zmo@chromium.org>
Auto-Submit: Thomas Anderson <thomasanderson@chromium.org>
Reviewed-by: default avatarZhenyao Mo <zmo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#839168}
parent 1efd086e
......@@ -56,12 +56,17 @@ bool NativeViewGLSurfaceEGLX11::Initialize(GLSurfaceFormat format) {
auto* connection = x11::Connection::Get();
// Query all child windows and store them. ANGLE creates a child window when
// eglCreateWidnowSurface is called on X11 and expose events from this window
// need to be received by this class.
// eglCreateWindowSurface is called on X11 and expose events from this window
// need to be received by this class. Since ANGLE is using a separate
// connection, we have to select expose events on our own connection.
if (auto reply =
connection->QueryTree({static_cast<x11::Window>(window_)}).Sync()) {
children_ = std::move(reply->children);
}
for (auto child : children_) {
connection->ChangeWindowAttributes(
{.window = child, .event_mask = x11::EventMask::Exposure});
}
dispatcher_set_ = true;
connection->AddEventObserver(this);
......
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