wineandroid: Notify Java also when a window is forcefully destroyed.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2017-06-01 09:44:26 +02:00
parent 347699d773
commit d05f4f5867
1 changed files with 16 additions and 1 deletions

View File

@ -305,6 +305,20 @@ static int wait_events( int timeout )
}
static WNDPROC desktop_orig_wndproc;
static LRESULT CALLBACK desktop_wndproc_wrapper( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp )
{
switch (msg)
{
case WM_PARENTNOTIFY:
if (LOWORD(wp) == WM_DESTROY) destroy_ioctl_window( (HWND)lp );
break;
}
return desktop_orig_wndproc( hwnd, msg, wp, lp );
}
/***********************************************************************
* ANDROID_MsgWaitForMultipleObjectsEx
*/
@ -334,7 +348,8 @@ BOOL CDECL ANDROID_CreateWindow( HWND hwnd )
init_event_queue();
start_android_device();
desktop_orig_wndproc = (WNDPROC)SetWindowLongPtrW( hwnd, GWLP_WNDPROC,
(LONG_PTR)desktop_wndproc_wrapper );
if (!(data = alloc_win_data( hwnd ))) return FALSE;
release_win_data( data );
}