win_d2d: fix mouse

This commit is contained in:
David Hrdlička
2018-07-19 14:52:40 +02:00
parent 7ea15090d9
commit 2125b3a5a6

View File

@@ -38,7 +38,7 @@
#include "win_d2d.h" #include "win_d2d.h"
static HWND d2d_hwnd; static HWND d2d_hwnd, old_hwndMain;
static ID2D1Factory *d2d_factory; static ID2D1Factory *d2d_factory;
static ID2D1HwndRenderTarget *d2d_hwndRT; static ID2D1HwndRenderTarget *d2d_hwndRT;
static ID2D1BitmapRenderTarget *d2d_btmpRT; static ID2D1BitmapRenderTarget *d2d_btmpRT;
@@ -343,9 +343,11 @@ d2d_close(void)
if (d2d_hwnd) if (d2d_hwnd)
{ {
hwndMain = old_hwndMain;
plat_set_input(hwndMain); plat_set_input(hwndMain);
DestroyWindow(d2d_hwnd); DestroyWindow(d2d_hwnd);
d2d_hwnd = NULL; d2d_hwnd = NULL;
old_hwndMain = NULL;
} }
} }
@@ -382,6 +384,9 @@ d2d_init_common(int fs)
hinstance, hinstance,
NULL); NULL);
old_hwndMain = hwndMain;
hwndMain = d2d_hwnd;
plat_set_input(d2d_hwnd); plat_set_input(d2d_hwnd);
SetFocus(d2d_hwnd); SetFocus(d2d_hwnd);