Platform/Unix/X11Display: Adding processEvent() to handle resize.
This commit is contained in:
parent
f07be50bd3
commit
7a694e8fd0
2 changed files with 20 additions and 0 deletions
|
|
@ -114,4 +114,22 @@ void X11Display::showCursor(bool value)
|
|||
// TODO: Implement
|
||||
}
|
||||
|
||||
void X11Display::processEvent(const ::XEvent& event)
|
||||
{
|
||||
Vector2u size;
|
||||
|
||||
switch(event.xany.type) {
|
||||
case ConfigureNotify:
|
||||
size.x = event.xconfigure.width;
|
||||
size.y = event.xconfigure.height;
|
||||
|
||||
if (m_size != size) {
|
||||
m_size = size;
|
||||
Log::info("X11: Resize event");
|
||||
onReshape(size.x, size.y);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace sp
|
||||
|
|
|
|||
|
|
@ -35,6 +35,8 @@ public :
|
|||
|
||||
virtual void showCursor(bool value);
|
||||
|
||||
void processEvent(const ::XEvent& event);
|
||||
|
||||
protected :
|
||||
|
||||
::Display* m_disp;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue