See also the report http://sourceforge.net/p/irrlicht/bugs/435/ and the downstream bug report https://github.com/minetest/minetest/issues/373 .
The fix is very simple, it corrects wrongly set parameters.
Code: Select all
diff --git a/source/Irrlicht/CIrrDeviceLinux.cpp b/source/Irrlicht/CIrrDeviceLinux.cpp
index 4c3dbeb..56418ca 100644
--- a/source/Irrlicht/CIrrDeviceLinux.cpp
+++ b/source/Irrlicht/CIrrDeviceLinux.cpp
@@ -2098,7 +2098,7 @@ const c8* CIrrDeviceLinux::getTextFromClipboard() const
Clipboard = "";
if (ownerWindow != None )
{
- XConvertSelection (XDisplay, X_ATOM_CLIPBOARD, XA_STRING, None, ownerWindow, CurrentTime);
+ XConvertSelection (XDisplay, X_ATOM_CLIPBOARD, XA_STRING, XA_PRIMARY, ownerWindow, CurrentTime);
XFlush (XDisplay);
// check for data
@@ -2107,7 +2107,7 @@ const c8* CIrrDeviceLinux::getTextFromClipboard() const
unsigned long numItems, bytesLeft, dummy;
unsigned char *data;
XGetWindowProperty (XDisplay, ownerWindow,
- XA_STRING, // property name
+ XA_PRIMARY, // property name
0, // offset
0, // length (we only check for data, so 0)
0, // Delete 0==false
@@ -2120,7 +2120,7 @@ const c8* CIrrDeviceLinux::getTextFromClipboard() const
if ( bytesLeft > 0 )
{
// there is some data to get
- int result = XGetWindowProperty (XDisplay, ownerWindow, XA_STRING, 0,
+ int result = XGetWindowProperty (XDisplay, ownerWindow, XA_PRIMARY, 0,
bytesLeft, 0, AnyPropertyType, &type, &format,
&numItems, &dummy, &data);
if (result == Success)