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

LibGUI+WindowServer: Remove ResizeEvent::old_size()

Turns out nobody was using this information anyway, so let's not go
through all the trouble of plumbing it from WindowServer to LibGUI.

Fixes #3247.
This commit is contained in:
Andreas Kling 2020-08-22 13:10:35 +02:00
parent 683ae4f7ad
commit e374eb3035
7 changed files with 18 additions and 33 deletions

View file

@ -221,18 +221,15 @@ private:
class ResizeEvent final : public Event {
public:
explicit ResizeEvent(const Gfx::IntSize& old_size, const Gfx::IntSize& size)
explicit ResizeEvent(const Gfx::IntSize& size)
: Event(Event::Resize)
, m_old_size(old_size)
, m_size(size)
{
}
const Gfx::IntSize& old_size() const { return m_old_size; }
const Gfx::IntSize& size() const { return m_size; }
private:
Gfx::IntSize m_old_size;
Gfx::IntSize m_size;
};

View file

@ -151,7 +151,7 @@ void Widget::set_relative_rect(const Gfx::IntRect& a_rect)
m_relative_rect = rect;
if (size_changed) {
ResizeEvent resize_event(m_relative_rect.size(), rect.size());
ResizeEvent resize_event(rect.size());
event(resize_event);
}

View file

@ -90,7 +90,7 @@ void WindowServerConnection::handle(const Messages::WindowClient::Paint& message
void WindowServerConnection::handle(const Messages::WindowClient::WindowResized& message)
{
if (auto* window = Window::from_window_id(message.window_id())) {
Core::EventLoop::current().post_event(*window, make<ResizeEvent>(message.old_rect().size(), message.new_rect().size()));
Core::EventLoop::current().post_event(*window, make<ResizeEvent>(message.new_rect().size()));
}
}