1
0
Fork 0

Platform/Unix/X11Display: in setSize() check if width or height is zero before calling XResizeWindow()

This commit is contained in:
Henrik Hautakoski 2020-10-27 19:39:25 +01:00
parent 50439a58bd
commit 0c76864b40

View file

@ -102,8 +102,16 @@ void* X11Display::getHandle() const
void X11Display::setSize(unsigned int width, unsigned int height)
{
m_size = Vector2u(width, height);
// X11 does not like if width or height is zero.
if (width == 0) {
width = 1;
}
if (height == 0) {
height = 1;
}
m_size = Vector2u(width, height);
::XResizeWindow(m_disp, m_win, m_size.x, m_size.y);
}