1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 13:38:11 +00:00

WindowServer: Preserve all members in MouseEvent::translated()

We were forgetting to preserve the m_drag and m_mime_data members of
WindowServer::MouseEvent when making a translated copy.

This didn't affect any reachable code paths before this change.
This commit is contained in:
Andreas Kling 2021-06-18 13:57:27 +02:00
parent bac200885c
commit 300711d013

View file

@ -117,7 +117,12 @@ public:
void set_drag(bool b) { m_drag = b; }
void set_mime_data(const Core::MimeData& mime_data) { m_mime_data = mime_data; }
MouseEvent translated(const Gfx::IntPoint& delta) const { return MouseEvent((Type)type(), m_position.translated(delta), m_buttons, m_button, m_modifiers, m_wheel_delta); }
MouseEvent translated(Gfx::IntPoint const& delta) const
{
MouseEvent event = *this;
event.m_position = m_position.translated(delta);
return event;
}
private:
Gfx::IntPoint m_position;