mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 08:27:35 +00:00
WindowServer: Don't crash when invalid resolution requested
This commit is contained in:
parent
1bc326f63b
commit
fc79fefb5e
1 changed files with 4 additions and 2 deletions
|
@ -421,7 +421,10 @@ bool Compositor::set_resolution(int desired_width, int desired_height)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
// Make sure it's impossible to set an invalid resolution
|
// Make sure it's impossible to set an invalid resolution
|
||||||
ASSERT(desired_width >= 640 && desired_height >= 480);
|
if (!(desired_width >= 640 && desired_height >= 480)) {
|
||||||
|
dbg() << "Compositor: Tried to set invalid resolution: " << desired_width << "x" << desired_height;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
bool success = Screen::the().set_resolution(desired_width, desired_height);
|
bool success = Screen::the().set_resolution(desired_width, desired_height);
|
||||||
init_bitmaps();
|
init_bitmaps();
|
||||||
compose();
|
compose();
|
||||||
|
@ -533,7 +536,6 @@ bool Compositor::any_opaque_window_contains_rect(const Gfx::IntRect& rect)
|
||||||
return found_containing_window;
|
return found_containing_window;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
bool Compositor::any_opaque_window_above_this_one_contains_rect(const Window& a_window, const Gfx::IntRect& rect)
|
bool Compositor::any_opaque_window_above_this_one_contains_rect(const Window& a_window, const Gfx::IntRect& rect)
|
||||||
{
|
{
|
||||||
bool found_containing_window = false;
|
bool found_containing_window = false;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue