mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 06:17:35 +00:00
WindowServer: Add sanity checks to create_window
IPC
This commit is contained in:
parent
ef92493aba
commit
0ff09d4f74
3 changed files with 10 additions and 2 deletions
|
@ -465,6 +465,11 @@ Messages::WindowServer::CreateWindowResponse ClientConnection::create_window(Gfx
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (type < 0 || type >= (i32)WindowType::_Count) {
|
||||||
|
did_misbehave("CreateWindow with a bad type");
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
int window_id = m_next_window_id++;
|
int window_id = m_next_window_id++;
|
||||||
auto window = Window::construct(*this, (WindowType)type, window_id, modal, minimizable, frameless, resizable, fullscreen, accessory, parent_window);
|
auto window = Window::construct(*this, (WindowType)type, window_id, modal, minimizable, frameless, resizable, fullscreen, accessory, parent_window);
|
||||||
|
|
||||||
|
@ -492,7 +497,8 @@ Messages::WindowServer::CreateWindowResponse ClientConnection::create_window(Gfx
|
||||||
window->set_alpha_hit_threshold(alpha_hit_threshold);
|
window->set_alpha_hit_threshold(alpha_hit_threshold);
|
||||||
window->set_size_increment(size_increment);
|
window->set_size_increment(size_increment);
|
||||||
window->set_base_size(base_size);
|
window->set_base_size(base_size);
|
||||||
window->set_resize_aspect_ratio(resize_aspect_ratio);
|
if (resize_aspect_ratio.has_value() && !resize_aspect_ratio.value().is_null())
|
||||||
|
window->set_resize_aspect_ratio(resize_aspect_ratio);
|
||||||
window->invalidate(true, true);
|
window->invalidate(true, true);
|
||||||
if (window->type() == WindowType::Applet)
|
if (window->type() == WindowType::Applet)
|
||||||
AppletManager::the().add_applet(*window);
|
AppletManager::the().add_applet(*window);
|
||||||
|
|
|
@ -208,7 +208,8 @@ void Window::nudge_into_desktop(bool force_titlebar_visible)
|
||||||
|
|
||||||
void Window::set_minimum_size(const Gfx::IntSize& size)
|
void Window::set_minimum_size(const Gfx::IntSize& size)
|
||||||
{
|
{
|
||||||
VERIFY(!size.is_empty());
|
if (size.is_null())
|
||||||
|
return;
|
||||||
|
|
||||||
if (m_minimum_size == size)
|
if (m_minimum_size == size)
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -20,6 +20,7 @@ enum class WindowType {
|
||||||
Desktop,
|
Desktop,
|
||||||
ToolWindow,
|
ToolWindow,
|
||||||
AppletArea,
|
AppletArea,
|
||||||
|
_Count
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue