Skip to content

Commit

Permalink
Further X11 clipboard patches
Browse files Browse the repository at this point in the history
  • Loading branch information
edo9300 authored and kevinlul committed Mar 7, 2020
1 parent f4a3f9a commit d158440
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions source/Irrlicht/CIrrDeviceLinux.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1912,16 +1912,15 @@ const c8* CIrrDeviceLinux::getTextFromClipboard()
&bytesLeft, // remaining bytes for partial reads
&data); // data
XFree(data);
if ( bytesLeft > 0 )
{
// there is some data to get
int result = XGetWindowProperty (display, ownerWindow, XA_PRIMARY, 0,
bytesLeft, 0, AnyPropertyType, &type, &format,
&numItems, &dummy, &data);
if (result == Success)
Clipboard = (irr::c8*)data;
XFree (data);
}

// there is some data to get
int result = XGetWindowProperty (display, ownerWindow, XA_PRIMARY, 0,
bytesLeft, 0, AnyPropertyType, &type, &format,
&numItems, &dummy, &data);
if (result == Success)
Clipboard = (irr::c8*)data;
XFree (data);

}

return Clipboard.c_str();
Expand Down

0 comments on commit d158440

Please sign in to comment.