[X11] Don't return closed windows from GetAcceleratedWidgetAtScreenPoint
This issue can manifest when quickly dragging tabs on tiling window managers. Bug: None Change-Id: Ib160ce88b7fb4e3801489511f9b4433bbfe7d291 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6176746 Commit-Queue: Maksim Sisov <msisov@igalia.com> Reviewed-by: Maksim Sisov <msisov@igalia.com> Auto-Submit: Thomas Anderson <thomasanderson@chromium.org> Cr-Commit-Position: refs/heads/main@{#1407147}
This commit is contained in:

committed by
Chromium LUCI CQ

parent
308592ff1d
commit
dcf2686ba2
@@ -162,8 +162,15 @@ gfx::AcceleratedWidget X11ScreenOzone::GetAcceleratedWidgetAtScreenPoint(
|
|||||||
const gfx::Point& point) const {
|
const gfx::Point& point) const {
|
||||||
gfx::Point point_in_pixels =
|
gfx::Point point_in_pixels =
|
||||||
gfx::ToFlooredPoint(PointDipToPx(GetAllDisplays(), point));
|
gfx::ToFlooredPoint(PointDipToPx(GetAllDisplays(), point));
|
||||||
return static_cast<gfx::AcceleratedWidget>(
|
auto widget = static_cast<gfx::AcceleratedWidget>(
|
||||||
x11::GetWindowAtPoint(point_in_pixels));
|
x11::GetWindowAtPoint(point_in_pixels));
|
||||||
|
auto* window = window_manager_->GetWindow(widget);
|
||||||
|
if (window && !window->IsVisible()) {
|
||||||
|
// The window cache may be out of sync with respect to recently changed
|
||||||
|
// window state. This can happen if the window was recently hidden.
|
||||||
|
return gfx::kNullAcceleratedWidget;
|
||||||
|
}
|
||||||
|
return widget;
|
||||||
}
|
}
|
||||||
|
|
||||||
gfx::AcceleratedWidget X11ScreenOzone::GetLocalProcessWidgetAtPoint(
|
gfx::AcceleratedWidget X11ScreenOzone::GetLocalProcessWidgetAtPoint(
|
||||||
|
Reference in New Issue
Block a user