Platform/Unix/X11Display: in setSize() check if width or height is zero before calling XResizeWindow()
This commit is contained in:
parent
50439a58bd
commit
0c76864b40
1 changed files with 9 additions and 1 deletions
|
|
@ -102,8 +102,16 @@ void* X11Display::getHandle() const
|
||||||
|
|
||||||
void X11Display::setSize(unsigned int width, unsigned int height)
|
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);
|
::XResizeWindow(m_disp, m_win, m_size.x, m_size.y);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue