From feb3d07466c63dc373451f2a0383463917fd49e6 Mon Sep 17 00:00:00 2001 From: cutealien Date: Wed, 25 Aug 2021 14:33:22 +0000 Subject: [PATCH] SIrrlichtCreationParameters::IgnoreInput set to false works again on X11. Thanks @ Victor Gaydov for report + patch + very good test cases! (bug #401) This had been broken since Irrlicht 1.6 The reason was that Irrlicht 1.6 wanted to ensure Irrlicht renders to given parent window instead of creating a child window in the parent window. That still works, but only with SIrrlichtCreationParameters::IgnoreInput set to true. Added a few comments about further improvements as rendering to the given parent Window is likely also possible for this case, but that will need more work. git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6237 dfc29bdd-3216-0410-991c-e03cc46cb475 --- changes.txt | 3 +++ source/Irrlicht/CIrrDeviceLinux.cpp | 15 ++++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/changes.txt b/changes.txt index f6d11bb1..04ee9dd8 100644 --- a/changes.txt +++ b/changes.txt @@ -1,5 +1,8 @@ -------------------------- Changes in 1.9 (not yet released) +- SIrrlichtCreationParameters::IgnoreInput set to false works again on X11. + Thanks @ Victor Gaydov for report + patch + very good test cases! (bug #401) + This had been broken since Irrlicht 1.6 - Add steer parameter to CSceneNodeAnimatorFollowSpline which allows rotating node toward direction of movement. Thanks @ Bate for the patch (patch #175) - Add a workaround for XWarpPointer bug that causes mouse to jump when users have set a Coordinate Transformation Matrix for their mouse on X11. diff --git a/source/Irrlicht/CIrrDeviceLinux.cpp b/source/Irrlicht/CIrrDeviceLinux.cpp index b0914f4c..1abd32ce 100644 --- a/source/Irrlicht/CIrrDeviceLinux.cpp +++ b/source/Irrlicht/CIrrDeviceLinux.cpp @@ -522,12 +522,25 @@ bool CIrrDeviceLinux::createWindow() XWindow = (Window)CreationParams.WindowId; if (!CreationParams.IgnoreInput) { - XCreateWindow(XDisplay, + // Note: This might be further improved by using a InputOnly window instead of InputOutput. + // I think then it should be possible to render into the given parent window instead of + // creating a child-window. + // That could also be a third option for IgnoreInput in the CreationParams. + // But we need another window variable then and have to split input/output in + // the rest of the device code. + // Also... this does possibly leak. + Window child_window = XCreateWindow(XDisplay, XWindow, 0, 0, Width, Height, 0, VisualInfo->depth, InputOutput, VisualInfo->visual, CWBorderPixel | CWColormap | CWEventMask, &WndAttributes); + + // do not forget to map new window + XMapWindow(XDisplay, child_window); + + // overwrite device window id + XWindow = child_window; } XWindowAttributes wa; XGetWindowAttributes(XDisplay, XWindow, &wa);