From 0c76864b40b0d11b14e07d12a92bad477b00c334 Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Tue, 27 Oct 2020 19:39:25 +0100 Subject: [PATCH] Platform/Unix/X11Display: in setSize() check if width or height is zero before calling XResizeWindow() --- source/Platform/Unix/X11Display.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/source/Platform/Unix/X11Display.cpp b/source/Platform/Unix/X11Display.cpp index f2f5289..9b54150 100644 --- a/source/Platform/Unix/X11Display.cpp +++ b/source/Platform/Unix/X11Display.cpp @@ -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); }