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
This commit is contained in:
cutealien 2021-08-25 14:33:22 +00:00
parent 4cebe6fbde
commit feb3d07466
2 changed files with 17 additions and 1 deletions

View File

@ -1,5 +1,8 @@
-------------------------- --------------------------
Changes in 1.9 (not yet released) 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. - Add steer parameter to CSceneNodeAnimatorFollowSpline which allows rotating node toward direction of movement.
Thanks @ Bate for the patch (patch #175) 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. - Add a workaround for XWarpPointer bug that causes mouse to jump when users have set a Coordinate Transformation Matrix for their mouse on X11.

View File

@ -522,12 +522,25 @@ bool CIrrDeviceLinux::createWindow()
XWindow = (Window)CreationParams.WindowId; XWindow = (Window)CreationParams.WindowId;
if (!CreationParams.IgnoreInput) 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, XWindow,
0, 0, Width, Height, 0, VisualInfo->depth, 0, 0, Width, Height, 0, VisualInfo->depth,
InputOutput, VisualInfo->visual, InputOutput, VisualInfo->visual,
CWBorderPixel | CWColormap | CWEventMask, CWBorderPixel | CWColormap | CWEventMask,
&WndAttributes); &WndAttributes);
// do not forget to map new window
XMapWindow(XDisplay, child_window);
// overwrite device window id
XWindow = child_window;
} }
XWindowAttributes wa; XWindowAttributes wa;
XGetWindowAttributes(XDisplay, XWindow, &wa); XGetWindowAttributes(XDisplay, XWindow, &wa);