mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Linux windowing: Display utf-8 native window titles correctly
This commit is contained in:
parent
8cc0d12fb3
commit
f989182f32
4 changed files with 12 additions and 3 deletions
|
|
@ -67,7 +67,7 @@ public:
|
|||
appProperties.setStorageParameters (options);
|
||||
}
|
||||
|
||||
const String getApplicationName() override { return JucePlugin_Name; }
|
||||
const String getApplicationName() override { return CharPointer_UTF8 (JucePlugin_Name); }
|
||||
const String getApplicationVersion() override { return JucePlugin_VersionString; }
|
||||
bool moreThanOneInstanceAllowed() override { return true; }
|
||||
void anotherInstanceStarted (const String&) override {}
|
||||
|
|
|
|||
|
|
@ -188,6 +188,7 @@ bool X11Symbols::loadAllSymbols()
|
|||
makeSymbolBinding (xUngrabServer, "XUngrabServer"),
|
||||
makeSymbolBinding (xUnlockDisplay, "XUnlockDisplay"),
|
||||
makeSymbolBinding (xUnmapWindow, "XUnmapWindow"),
|
||||
makeSymbolBinding (xutf8TextListToTextProperty, "Xutf8TextListToTextProperty"),
|
||||
makeSymbolBinding (xWarpPointer, "XWarpPointer")))
|
||||
return false;
|
||||
|
||||
|
|
|
|||
|
|
@ -449,6 +449,10 @@ public:
|
|||
(char**, int, XTextProperty*),
|
||||
Status)
|
||||
|
||||
JUCE_GENERATE_FUNCTION_WITH_DEFAULT (Xutf8TextListToTextProperty, xutf8TextListToTextProperty,
|
||||
(::Display*, char**, int, XICCEncodingStyle, XTextProperty*),
|
||||
int)
|
||||
|
||||
JUCE_GENERATE_FUNCTION_WITH_DEFAULT (XSync, xSync,
|
||||
(::Display*, Bool),
|
||||
void)
|
||||
|
|
|
|||
|
|
@ -1606,12 +1606,16 @@ void XWindowSystem::setTitle (::Window windowH, const String& title) const
|
|||
{
|
||||
jassert (windowH != 0);
|
||||
|
||||
XTextProperty nameProperty;
|
||||
XTextProperty nameProperty{};
|
||||
char* strings[] = { const_cast<char*> (title.toRawUTF8()) };
|
||||
|
||||
XWindowSystemUtilities::ScopedXLock xLock;
|
||||
|
||||
if (X11Symbols::getInstance()->xStringListToTextProperty (strings, 1, &nameProperty))
|
||||
if (X11Symbols::getInstance()->xutf8TextListToTextProperty (display,
|
||||
strings,
|
||||
numElementsInArray (strings),
|
||||
XUTF8StringStyle,
|
||||
&nameProperty) >= 0)
|
||||
{
|
||||
X11Symbols::getInstance()->xSetWMName (display, windowH, &nameProperty);
|
||||
X11Symbols::getInstance()->xSetWMIconName (display, windowH, &nameProperty);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue