Alexandre Julliard : wineandroid: Update the contents when we receive a new surface from Java.
Alexandre Julliard
julliard at winehq.org
Tue Jun 6 15:23:28 CDT 2017
Module: wine
Branch: master
Commit: 20c627d58cb8f08aad0e086dd73760ecad987986
URL: http://source.winehq.org/git/wine.git/?a=commit;h=20c627d58cb8f08aad0e086dd73760ecad987986
Author: Alexandre Julliard <julliard at winehq.org>
Date: Tue Jun 6 08:33:09 2017 +0200
wineandroid: Update the contents when we receive a new surface from Java.
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/wineandroid.drv/android.h | 5 +++++
dlls/wineandroid.drv/device.c | 2 ++
dlls/wineandroid.drv/window.c | 30 ++++++++++++++++++++++++++++++
dlls/wineandroid.drv/wineandroid.drv.spec | 1 +
4 files changed, 38 insertions(+)
diff --git a/dlls/wineandroid.drv/android.h b/dlls/wineandroid.drv/android.h
index bfdd697..3c2500e 100644
--- a/dlls/wineandroid.drv/android.h
+++ b/dlls/wineandroid.drv/android.h
@@ -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 */
diff --git a/dlls/wineandroid.drv/device.c b/dlls/wineandroid.drv/device.c
index fdcf24a..1af59be 100644
--- a/dlls/wineandroid.drv/device.c
+++ b/dlls/wineandroid.drv/device.c
@@ -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 );
}
diff --git a/dlls/wineandroid.drv/window.c b/dlls/wineandroid.drv/window.c
index 64333cb..203492a 100644
--- a/dlls/wineandroid.drv/window.c
+++ b/dlls/wineandroid.drv/window.c
@@ -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
*/
diff --git a/dlls/wineandroid.drv/wineandroid.drv.spec b/dlls/wineandroid.drv/wineandroid.drv.spec
index 84ed7fd..7379458 100644
--- a/dlls/wineandroid.drv/wineandroid.drv.spec
+++ b/dlls/wineandroid.drv/wineandroid.drv.spec
@@ -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
More information about the wine-cvs
mailing list