Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--intern/ghost/intern/GHOST_WindowWin32.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/intern/ghost/intern/GHOST_WindowWin32.cpp b/intern/ghost/intern/GHOST_WindowWin32.cpp
index 1b73b765b49..762ee6bc0eb 100644
--- a/intern/ghost/intern/GHOST_WindowWin32.cpp
+++ b/intern/ghost/intern/GHOST_WindowWin32.cpp
@@ -306,9 +306,13 @@ void GHOST_WindowWin32::setTitle(const char *title)
std::string GHOST_WindowWin32::getTitle() const
{
- char buf[s_maxTitleLength]; /* CHANGE + never used yet. */
- ::GetWindowText(m_hWnd, buf, s_maxTitleLength);
- return std::string(buf);
+ std::wstring wtitle(::GetWindowTextLengthW(m_hWnd) + 1, L'\0');
+ ::GetWindowTextW(m_hWnd, &wtitle[0], wtitle.capacity());
+
+ std::string title(count_utf_8_from_16(wtitle.c_str()) + 1, '\0');
+ conv_utf_16_to_8(wtitle.c_str(), &title[0], title.capacity());
+
+ return title;
}
void GHOST_WindowWin32::getWindowBounds(GHOST_Rect &bounds) const