diff options
author | bruvzg <7645683+bruvzg@users.noreply.github.com> | 2024-03-15 09:18:48 +0200 |
---|---|---|
committer | bruvzg <7645683+bruvzg@users.noreply.github.com> | 2024-03-15 09:48:54 +0200 |
commit | 3459aaa9d15466292ee5fc7d2497b2d3894da0fe (patch) | |
tree | 84dfa69ab89c8b0beb9dd4f49a5fd1dfc0f710ba /platform/windows/native_menu_windows.cpp | |
parent | 0175be8948d68cf90c55ce08e8e5bf46ea29ce40 (diff) | |
download | redot-engine-3459aaa9d15466292ee5fc7d2497b2d3894da0fe.tar.gz |
Fix NativeMenu layout direction on macOS, add extra check for Windows menu.
Diffstat (limited to 'platform/windows/native_menu_windows.cpp')
-rw-r--r-- | platform/windows/native_menu_windows.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/platform/windows/native_menu_windows.cpp b/platform/windows/native_menu_windows.cpp index eea30cab9a..84e3611e91 100644 --- a/platform/windows/native_menu_windows.cpp +++ b/platform/windows/native_menu_windows.cpp @@ -289,7 +289,7 @@ int NativeMenuWindows::add_item(const RID &p_rid, const String &p_label, const C item.fMask = MIIM_FTYPE | MIIM_STRING | MIIM_DATA; item.fType = MFT_STRING; item.dwItemData = (ULONG_PTR)item_data; - item.dwTypeData = (LPWSTR)label.ptrw(); + item.dwTypeData = label.ptrw() ? (LPWSTR)label.ptrw() : L""; if (!InsertMenuItemW(md->menu, p_index, true, &item)) { memdelete(item_data); @@ -949,7 +949,7 @@ void NativeMenuWindows::set_item_text(const RID &p_rid, int p_idx, const String item.cbSize = sizeof(item); item.fMask = MIIM_FTYPE | MIIM_STRING | MIIM_DATA; if (GetMenuItemInfoW(md->menu, p_idx, true, &item)) { - item.dwTypeData = (LPWSTR)label.ptrw(); + item.dwTypeData = label.ptrw() ? (LPWSTR)label.ptrw() : L""; SetMenuItemInfoW(md->menu, p_idx, true, &item); } } |