From 0efb07bc668a87ea0fa18bd56a48d9c82b4a87d7 Mon Sep 17 00:00:00 2001 From: ChickenPeanut Date: Sun, 3 Sep 2017 18:52:34 -0400 Subject: [PATCH] Fixed BadValue with XCreateWindow xf_FixWindowCoordinates occasionally set the dimensions of the window to invalid values (0) because the minimum value check was done at the beginning of the method rather than at the end --- client/X11/xf_window.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/client/X11/xf_window.c b/client/X11/xf_window.c index 321fdf6..e0d9307 100644 --- a/client/X11/xf_window.c +++ b/client/X11/xf_window.c @@ -594,16 +594,6 @@ void xf_FixWindowCoordinates(xfContext* xfc, int* x, int* y, int* width, vscreen_width = xfc->vscreen.area.right - xfc->vscreen.area.left + 1; vscreen_height = xfc->vscreen.area.bottom - xfc->vscreen.area.top + 1; - if (*width < 1) - { - *width = 1; - } - - if (*height < 1) - { - *height = 1; - } - if (*x < xfc->vscreen.area.left) { *width += *x; @@ -625,6 +615,16 @@ void xf_FixWindowCoordinates(xfContext* xfc, int* x, int* y, int* width, { *height = vscreen_height; } + + if (*width < 1) + { + *width = 1; + } + + if (*height < 1) + { + *height = 1; + } } int xf_AppWindowInit(xfContext* xfc, xfAppWindow* appWindow) -- 2.7.4