wineandroid: Update the contents when we receive a new surface from Java.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2017-06-06 08:33:09 +02:00
parent 7f92cbf520
commit 20c627d58c
4 changed files with 38 additions and 0 deletions

View File

@ -71,6 +71,11 @@ extern unsigned int screen_height DECLSPEC_HIDDEN;
extern RECT virtual_screen_rect DECLSPEC_HIDDEN;
extern MONITORINFOEXW default_monitor DECLSPEC_HIDDEN;
enum android_window_messages
{
WM_ANDROID_REFRESH = 0x80001000,
};
extern void init_monitors( int width, int height ) DECLSPEC_HIDDEN;
/* JNI entry points */

View File

@ -433,6 +433,7 @@ static void CALLBACK register_native_window_callback( ULONG_PTR arg1, ULONG_PTR
if (!data || data->parent == win)
{
if (win) pANativeWindow_release( win );
if (data && win) PostMessageW( hwnd, WM_ANDROID_REFRESH, 0, 0 );
TRACE( "%p -> %p win %p (unchanged)\n", hwnd, data, win );
return;
}
@ -446,6 +447,7 @@ static void CALLBACK register_native_window_callback( ULONG_PTR arg1, ULONG_PTR
win->perform( win, NATIVE_WINDOW_SET_BUFFERS_FORMAT, data->buffer_format );
win->setSwapInterval( win, data->swap_interval );
unwrap_java_call();
PostMessageW( hwnd, WM_ANDROID_REFRESH, 0, 0 );
}
TRACE( "%p -> %p win %p\n", hwnd, data, win );
}

View File

@ -977,6 +977,36 @@ void CDECL ANDROID_WindowPosChanged( HWND hwnd, HWND insert_after, UINT swp_flag
}
/**********************************************************************
* ANDROID_WindowMessage
*/
LRESULT CDECL ANDROID_WindowMessage( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp )
{
struct android_win_data *data;
switch (msg)
{
case WM_ANDROID_REFRESH:
if ((data = get_win_data( hwnd )))
{
struct window_surface *surface = data->surface;
if (surface)
{
surface->funcs->lock( surface );
*surface->funcs->get_bounds( surface ) = surface->rect;
surface->funcs->unlock( surface );
if (is_argb_surface( surface )) surface->funcs->flush( surface );
}
release_win_data( data );
}
return 0;
default:
FIXME( "got window msg %x hwnd %p wp %lx lp %lx\n", msg, hwnd, wp, lp );
return 0;
}
}
/***********************************************************************
* ANDROID_create_desktop
*/

View File

@ -9,6 +9,7 @@
@ cdecl CreateWindow(long) ANDROID_CreateWindow
@ cdecl DestroyWindow(long) ANDROID_DestroyWindow
@ cdecl MsgWaitForMultipleObjectsEx(long ptr long long long) ANDROID_MsgWaitForMultipleObjectsEx
@ cdecl WindowMessage(long long long long) ANDROID_WindowMessage
@ cdecl WindowPosChanging(long long long ptr ptr ptr ptr) ANDROID_WindowPosChanging
@ cdecl WindowPosChanged(long long long ptr ptr ptr ptr ptr) ANDROID_WindowPosChanged