1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 01:37:35 +00:00

WindowServer: Constrain rendering windows to one screen in some cases

When a window is maximized or tiled then we want to constrain rendering
that window to the screen it's on. This prevents "bleeding" of the
window frame and shadow onto the adjacent screen(s).
This commit is contained in:
Tom 2021-06-13 17:39:28 -06:00 committed by Andreas Kling
parent 4392da970a
commit 229b541e5d
3 changed files with 34 additions and 11 deletions

View file

@ -988,7 +988,10 @@ Optional<HitTestResult> Window::hit_test(Gfx::IntPoint const& position, bool inc
{
if (!m_hit_testing_enabled)
return {};
if (!frame().rect().contains(position))
// We need to check the (possibly constrained) render rect to make sure
// we don't hit-test on a window that is constrained to a screen, but somehow
// (partially) moved into another screen where it's not rendered
if (!frame().rect().intersected(frame().render_rect()).contains(position))
return {};
if (!rect().contains(position)) {
if (include_frame)