1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 22:47:47 +00:00

WindowServer: Use is_internal() instead of checking if the client exists

This commit is contained in:
Sam Atkins 2021-11-22 16:03:20 +00:00 committed by Andreas Kling
parent 1298c27ca9
commit a330a070d4

View file

@ -146,7 +146,7 @@ void Window::set_rect(const Gfx::IntRect& rect)
m_rect = rect;
if (rect.is_empty()) {
m_backing_store = nullptr;
} else if (!m_client && (!m_backing_store || old_rect.size() != rect.size())) {
} else if (is_internal() && (!m_backing_store || old_rect.size() != rect.size())) {
auto format = has_alpha_channel() ? Gfx::BitmapFormat::BGRA8888 : Gfx::BitmapFormat::BGRx8888;
m_backing_store = Gfx::Bitmap::try_create(format, m_rect.size()).release_value_but_fixme_should_propagate_errors();
}
@ -525,7 +525,7 @@ void Window::set_resizable(bool resizable)
void Window::event(Core::Event& event)
{
if (!m_client) {
if (is_internal()) {
VERIFY(parent());
event.ignore();
return;