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:
parent
7f92cbf520
commit
20c627d58c
|
@ -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 */
|
||||
|
|
|
@ -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 );
|
||||
}
|
||||
|
|
|
@ -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
|
||||
*/
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue