Fixed the Unix clipboard implementation causing an abort due to internal data races in Xlib.

This commit is contained in:
binary1248 2018-05-15 23:28:32 +02:00 committed by Lukas Dürrenberger
parent b97a5be615
commit 235abae134
4 changed files with 420 additions and 204 deletions

View file

@ -60,7 +60,12 @@ public:
/// This function sets the content of the clipboard as a
/// string.
///
/// \param text sf::String containing the data to be sent
/// \warning Due to limitations on some operating systems,
/// setting the clipboard contents is only
/// guaranteed to work if there is currently an
/// open window for which events are being handled.
///
/// \param text sf::String containing the data to be sent
/// to the clipboard
///
////////////////////////////////////////////////////////////
@ -80,6 +85,11 @@ public:
/// sf::Clipboard provides an interface for getting and
/// setting the contents of the system clipboard.
///
/// It is important to note that due to limitations on some
/// operating systems, setting the clipboard contents is
/// only guaranteed to work if there is currently an open
/// window for which events are being handled.
///
/// Usage example:
/// \code
/// // get the clipboard content as a string
@ -96,11 +106,12 @@ public:
/// // Using Ctrl + V to paste a string into SFML
/// if(event.key.control && event.key.code == sf::Keyboard::V)
/// string = sf::Clipboard::getString();
///
/// // Using Ctrl + C to copy a string out of SFML
/// if(event.key.control && event.key.code == sf::Keyboard::C)
/// sf::Clipboard::setString("Hello World!");
/// }
/// }
///
/// // set the clipboard to a string
/// sf::Clipboard::setString("Hello World!");
/// \endcode
///
/// \see sf::String, sf::Event