(windows) Fixes drag and drop - we have to call this

function directly since the UI companion driver interface at
this point has not yet been initialized
This commit is contained in:
twinaphex 2016-07-16 23:49:44 +02:00
parent c6e6e300b9
commit a8de87576e
2 changed files with 5 additions and 7 deletions

View File

@ -381,6 +381,8 @@ static LRESULT CALLBACK WndProcCommon(bool *quit, HWND hwnd, UINT message,
return 0; return 0;
} }
extern void ui_window_win32_set_droppable(void *data, bool droppable);
LRESULT CALLBACK WndProcD3D(HWND hwnd, UINT message, LRESULT CALLBACK WndProcD3D(HWND hwnd, UINT message,
WPARAM wparam, LPARAM lparam) WPARAM wparam, LPARAM lparam)
{ {
@ -410,15 +412,13 @@ LRESULT CALLBACK WndProcD3D(HWND hwnd, UINT message,
case WM_CREATE: case WM_CREATE:
{ {
ui_window_win32_t win32_window; ui_window_win32_t win32_window;
const ui_window_t *window = ui_companion_driver_get_window_ptr();
LPCREATESTRUCT p_cs = (LPCREATESTRUCT)lparam; LPCREATESTRUCT p_cs = (LPCREATESTRUCT)lparam;
curD3D = p_cs->lpCreateParams; curD3D = p_cs->lpCreateParams;
g_inited = true; g_inited = true;
win32_window.hwnd = hwnd; win32_window.hwnd = hwnd;
if (window) ui_window_win32_set_droppable(&win32_window, true);
window->set_droppable(&win32_window, true);
} }
return 0; return 0;
} }
@ -459,13 +459,11 @@ LRESULT CALLBACK WndProcGL(HWND hwnd, UINT message,
case WM_CREATE: case WM_CREATE:
{ {
ui_window_win32_t win32_window; ui_window_win32_t win32_window;
const ui_window_t *window = ui_companion_driver_get_window_ptr();
win32_window.hwnd = hwnd; win32_window.hwnd = hwnd;
create_graphics_context(hwnd, &g_quit); create_graphics_context(hwnd, &g_quit);
if (window) ui_window_win32_set_droppable(&win32_window, true);
window->set_droppable(&win32_window, true);
} }
return 0; return 0;
} }

View File

@ -75,7 +75,7 @@ static void ui_window_win32_set_title(void *data, char *buf)
SetWindowText(window->hwnd, buf); SetWindowText(window->hwnd, buf);
} }
static void ui_window_win32_set_droppable(void *data, bool droppable) void ui_window_win32_set_droppable(void *data, bool droppable)
{ {
/* Minimum supported client: Windows XP, minimum supported server: Windows 2000 Server */ /* Minimum supported client: Windows XP, minimum supported server: Windows 2000 Server */
ui_window_win32_t *window = (ui_window_win32_t*)data; ui_window_win32_t *window = (ui_window_win32_t*)data;