Skip to content

Commit

Permalink
Fix drop path encoding on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
luboslenco committed Feb 17, 2025
1 parent 223acd8 commit b3fd929
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions armorcore/sources/iron.h
Original file line number Diff line number Diff line change
Expand Up @@ -706,12 +706,18 @@ void _drop_files(wchar_t *file_path, void *data) {
#ifdef KINC_WINDOWS
POINT p;
GetCursorPos(&p);
ScreenToClient(kinc_windows_window_handle(), &p);
_mouse_move(p.x, p.y, 0, 0, NULL);
ScreenToClient(kinc_windows_window_handle(0), &p);
_mouse_move(0, p.x, p.y, 0, 0, NULL);
#endif

char buffer[512];
char buffer[1024];

#ifdef KINC_WINDOWS
WideCharToMultiByte(CP_UTF8, 0, file_path, wcslen(file_path), buffer, sizeof(buffer), NULL, NULL);
#else
wcstombs(buffer, file_path, sizeof(buffer));
#endif

iron_drop_files(buffer);
in_background = false;

Expand Down

0 comments on commit b3fd929

Please sign in to comment.