1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 05:17:34 +00:00

WindowServer: Normalize preferred rect before applying

Previously, SetWindowRect and SetWindowRect could supply basically arbitrary
x and y coordinates. This could happen either due to a malicious or malfunctioning
program, or even due to the auto-centering feature.

This patch also moves the 'normalization' code out of ClientConnection to Window,
where it belongs better.

Fixes #4135.
Fixes #5052.
This commit is contained in:
Ben Wiederhake 2021-01-22 21:46:59 +01:00 committed by Andreas Kling
parent 345909c009
commit 399908e53c
3 changed files with 33 additions and 15 deletions

View file

@ -158,6 +158,7 @@ public:
void set_rect(const Gfx::IntRect&);
void set_rect(int x, int y, int width, int height) { set_rect({ x, y, width, height }); }
void set_rect_without_repaint(const Gfx::IntRect&);
void normalize_rect();
void set_taskbar_rect(const Gfx::IntRect&);
const Gfx::IntRect& taskbar_rect() const { return m_taskbar_rect; }