summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrew Opalach <andrew@akon.city> 2026-09-14 08:52:41 -0400
committerAndrew Opalach <andrew@akon.city> 2026-09-14 08:52:41 -0400
commit07db5fdfccc9ee90c6b0a36aaad6b4f71b258cd3 (patch)
tree9ed46a3e89100d81a3801c472c4068573c3088aa /src
parente72c336d01b32bee304c8a2989e2335fcc26c143 (diff)
downloadstela-master.tar.gz
stela-master.tar.bz2
stela-master.zip
DragQueryFile A -> WHEADmaster
Signed-off-by: Andrew Opalach <andrew@akon.city>
Diffstat (limited to 'src')
-rw-r--r--src/window_win32.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/window_win32.c b/src/window_win32.c
index bf9ad87..e28d3d4 100644
--- a/src/window_win32.c
+++ b/src/window_win32.c
@@ -1316,15 +1316,19 @@ static void win32_handle_message(struct stl_window_win32 *w32, MSG *Message)
#ifdef STELA_DRAG_AND_DROP
case WM_DROPFILES: {
HDROP Drop = (HDROP)Message->wParam;
- str path = AL_STR_EMPTY;
- u32 count = DragQueryFileA(Drop, 0xffffffff, NULL, 0);
+ wstr buf = AL_WSTR_EMPTY;
+ u32 count = DragQueryFileW(Drop, 0xffffffff, NULL, 0);
for (u32 i = 0; i < count; i++) {
- path.length = DragQueryFileA(Drop, i, NULL, 0);
- path.alloc = al_str_reserve(&path, path.length + 1);
- DragQueryFileA(Drop, i, path.data, path.alloc);
- stl_window_send_drag_and_drop_event(&w32->w, &path);
+ buf.length = DragQueryFileW(Drop, i, NULL, 0);
+ buf.alloc = al_wstr_reserve(&buf, buf.length + 1);
+ DragQueryFileW(Drop, i, buf.data, buf.alloc);
+ str path = AL_STR_EMPTY;
+ if (al_str_from_wstr(&path, &buf)) {
+ stl_window_send_drag_and_drop_event(&w32->w, &path);
+ al_str_free(&path);
+ }
}
- al_str_free(&path);
+ al_wstr_free(&buf);
DragFinish(Drop);
break;
}