From dde5021232cda0a360e5937bdd54296abccb2cb3 Mon Sep 17 00:00:00 2001 From: "Adam D. Ruppe" Date: Sun, 19 Mar 2017 07:55:24 -0400 Subject: [PATCH] ketmar sdpy manual non-opengl window resizing segfault fix --- simpledisplay.d | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/simpledisplay.d b/simpledisplay.d index e8fb976..39b56f4 100644 --- a/simpledisplay.d +++ b/simpledisplay.d @@ -4449,8 +4449,7 @@ version(Windows) { // same position, new size for the client rectangle MoveWindow(hwnd, rect.left, rect.top, rect.right, rect.bottom, true); - version(without_opengl) {} else - glViewport(0, 0, w, h); + version(without_opengl) {} else if (openglMode == OpenGlOptions.yes) glViewport(0, 0, w, h); } void moveResize (int x, int y, int w, int h) { @@ -4465,8 +4464,7 @@ version(Windows) { throw new Exception("AdjustWindowRect"); MoveWindow(hwnd, rect.left, rect.top, rect.right, rect.bottom, true); - version(without_opengl) {} else - glViewport(0, 0, w, h); + version(without_opengl) {} else if (openglMode == OpenGlOptions.yes) glViewport(0, 0, w, h); if (windowResized !is null) windowResized(w, h); } @@ -5724,8 +5722,7 @@ version(X11) { if (w < 1) w = 1; if (h < 1) h = 1; XResizeWindow(display, window, w, h); - version(without_opengl) {} else - glViewport(0, 0, w, h); + version(without_opengl) {} else if (openglMode == OpenGlOptions.yes) glViewport(0, 0, w, h); if (windowResized !is null) windowResized(w, h); } @@ -5733,8 +5730,7 @@ version(X11) { if (w < 1) w = 1; if (h < 1) h = 1; XMoveResizeWindow(display, window, x, y, w, h); - version(without_opengl) {} else - glViewport(0, 0, w, h); + version(without_opengl) {} else if (openglMode == OpenGlOptions.yes) glViewport(0, 0, w, h); if (windowResized !is null) windowResized(w, h); }