Fix X11 selections (#55)

This fixes all the issues with the X11 selection in addition to switching the clipboard to always be UTF-8.
This commit is contained in:
DS
2021-08-30 21:44:56 +02:00
committed by GitHub
parent 75b4c05741
commit 9c4b6f25ab
6 changed files with 245 additions and 83 deletions

View File

@ -108,12 +108,13 @@ namespace irr
virtual bool getGammaRamp( f32 &red, f32 &green, f32 &blue, f32 &brightness, f32 &contrast ) _IRR_OVERRIDE_;
//! gets text from the clipboard
//! \return Returns 0 if no string is in there.
virtual const c8* getTextFromClipboard() const;
//! \return Returns 0 if no string is in there, otherwise utf-8 text.
virtual const c8 *getTextFromClipboard() const;
//! copies text to the clipboard
//! This sets the clipboard selection and _not_ the primary selection which you have on X on the middle mouse button.
virtual void copyToClipboard(const c8* text) const;
//! @param text The text in utf-8
virtual void copyToClipboard(const c8 *text) const;
//! Remove all messages pending in the system message loop
virtual void clearSystemMessages() _IRR_OVERRIDE_;
@ -425,6 +426,7 @@ namespace irr
XIM XInputMethod;
XIC XInputContext;
bool HasNetWM;
// text is utf-8
mutable core::stringc Clipboard;
#endif
u32 Width, Height;