Deliver mouse events to the appropriate Window.

This commit is contained in:
Andreas Kling 2018-10-12 01:26:20 +02:00
commit 5d125e40d9
Notes: sideshowbarker 2024-07-19 18:50:29 +09:00
3 changed files with 16 additions and 1 deletions

View file

@ -1,5 +1,6 @@
#include "Window.h"
#include "WindowManager.h"
#include "Event.h"
Window::Window(Object* parent)
: Object(parent)
@ -37,3 +38,14 @@ void Window::setRect(const Rect& rect)
m_rect = rect;
WindowManager::the().notifyRectChanged(*this, oldRect, m_rect);
}
void Window::event(Event& event)
{
if (event.isMouseEvent()) {
auto& me = static_cast<MouseEvent&>(event);
printf("Window{%p}: %s %d,%d\n", this, me.name(), me.x(), me.y());
return Object::event(event);
}
return Object::event(event);
}