-
-
Notifications
You must be signed in to change notification settings - Fork 10.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use DefWindowProcW in win32 examples #5961
Conversation
Fixes the window title from being truncated on calls to Platform_SetWindowTitle. Stops the WM_SETTEXT message that happens when calling setWindowTextW from being interpreted as ascii.
Hello, Thanks for the PR but this needs clarification. Please clarify how you are compiling the examples and what to do to repro said issue. (So i can confirm it locally). thanks! |
Oh, your right, now I see the |
I am still interested in this. |
In the docking branch, if your remove Add to this main loop ImGuiViewport* viewport = ImGui::GetMainViewport();
ImGui::GetPlatformIO().Platform_SetWindowTitle(viewport, "Dynamic Title"); You get the behavior I was getting. |
9 chances out of 10 the string was still getting converted to full unicode before passed to |
@nicolasnoble yes, without the complier defs, |
Yep, that's the wrong codepath :) We shouldn't call ASCII software will simply misbehave if passed a non-ASCII UTF-8 string, but there's little to do in this case... |
While #5975 is not as evident because it is a demo app, we should definitively make the multi-viewport backend behave with applications not compiled with
|
My apologies for misunderstanding this the first round. I have now merged your PR as fe0a24f |
The current win32 examples will truncate the window title if you try to modify it with
Platform_SetWindowTitle
.Before
After
It took me a while to figure out it was because the examples are using
DefWindowProc
insteadDefWindowProcW
.The issue is
setWindowTextW
sends aWM_SETTEXT
message toWndProc
and gets interpreted as ascii.Maybe this fix will help others from having to debug this issue when they are getting started using the examples :)