mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-15 05:04:15 +01:00
Make CJK imes work better
This commit is contained in:
parent
280a9d6b05
commit
b6d88f798a
9 changed files with 1064 additions and 466 deletions
|
|
@ -426,6 +426,26 @@ public static class ImGuiHelpers
|
|||
/// <param name="ptr">The pointer.</param>
|
||||
/// <returns>Whether it is empty.</returns>
|
||||
public static unsafe bool IsNull(this ImFontAtlasPtr ptr) => ptr.NativePtr == null;
|
||||
|
||||
/// <summary>
|
||||
/// Finds the corresponding ImGui viewport ID for the given window handle.
|
||||
/// </summary>
|
||||
/// <param name="hwnd">The window handle.</param>
|
||||
/// <returns>The viewport ID, or -1 if not found.</returns>
|
||||
internal static unsafe int FindViewportId(nint hwnd)
|
||||
{
|
||||
if (!IsImGuiInitialized)
|
||||
return -1;
|
||||
|
||||
var viewports = new ImVectorWrapper<ImGuiViewportPtr>(&ImGui.GetPlatformIO().NativePtr->Viewports);
|
||||
for (var i = 0; i < viewports.LengthUnsafe; i++)
|
||||
{
|
||||
if (viewports.DataUnsafe[i].PlatformHandle == hwnd)
|
||||
return i;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get data needed for each new frame.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue