Alexandre Julliard : wineandroid: Also create HWND_MESSAGE windows on the Java side.
Alexandre Julliard
julliard at winehq.org
Thu Jun 22 16:50:52 CDT 2017
Module: wine
Branch: master
Commit: f39e021006fe4131618f26138c7e7ddc6223ad92
URL: http://source.winehq.org/git/wine.git/?a=commit;h=f39e021006fe4131618f26138c7e7ddc6223ad92
Author: Alexandre Julliard <julliard at winehq.org>
Date: Thu Jun 22 20:04:43 2017 +0200
wineandroid: Also create HWND_MESSAGE windows on the Java side.
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/wineandroid.drv/WineActivity.java | 5 +++++
dlls/wineandroid.drv/device.c | 12 +++++++++---
dlls/wineandroid.drv/window.c | 27 ++-------------------------
3 files changed, 16 insertions(+), 28 deletions(-)
diff --git a/dlls/wineandroid.drv/WineActivity.java b/dlls/wineandroid.drv/WineActivity.java
index 742fabc..295ecc4 100644
--- a/dlls/wineandroid.drv/WineActivity.java
+++ b/dlls/wineandroid.drv/WineActivity.java
@@ -62,6 +62,7 @@ public class WineActivity extends Activity
private ProgressDialog progress_dialog;
protected WineWindow desktop_window;
+ protected WineWindow message_window;
@Override
public void onCreate(Bundle savedInstanceState)
@@ -290,6 +291,7 @@ public class WineActivity extends Activity
protected class WineWindow extends Object
{
+ static protected final int HWND_MESSAGE = 0xfffffffd;
static protected final int WS_VISIBLE = 0x10000000;
protected int hwnd;
@@ -617,6 +619,9 @@ public class WineActivity extends Activity
desktop_window = new WineWindow( hwnd, null );
addView( desktop_window.create_whole_view() );
desktop_window.client_group.bringToFront();
+
+ message_window = new WineWindow( WineWindow.HWND_MESSAGE, null );
+ message_window.create_window_groups();
}
@Override
diff --git a/dlls/wineandroid.drv/device.c b/dlls/wineandroid.drv/device.c
index d17b7c5..54c409b 100644
--- a/dlls/wineandroid.drv/device.c
+++ b/dlls/wineandroid.drv/device.c
@@ -251,6 +251,13 @@ static struct native_win_data *get_ioctl_native_win_data( const struct ioctl_hea
return get_native_win_data( LongToHandle(hdr->hwnd), hdr->opengl );
}
+static int get_ioctl_win_parent( HWND parent )
+{
+ if (parent != GetDesktopWindow() && !GetAncestor( parent, GA_PARENT ))
+ return HandleToLong( HWND_MESSAGE );
+ return HandleToLong( parent );
+}
+
static void wait_fence_and_close( int fence )
{
__s32 timeout = 1000; /* FIXME: should be -1 for infinite timeout */
@@ -1353,7 +1360,6 @@ struct ANativeWindow *create_ioctl_window( HWND hwnd, BOOL opengl )
{
struct ioctl_android_create_window req;
struct native_win_wrapper *win = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*win) );
- HWND parent = GetAncestor( hwnd, GA_PARENT );
if (!win) return NULL;
@@ -1378,7 +1384,7 @@ struct ANativeWindow *create_ioctl_window( HWND hwnd, BOOL opengl )
req.hdr.hwnd = HandleToLong( win->hwnd );
req.hdr.opengl = win->opengl;
- req.parent = HandleToLong( parent );
+ req.parent = get_ioctl_win_parent( GetAncestor( hwnd, GA_PARENT ));
android_ioctl( IOCTL_CREATE_WINDOW, &req, sizeof(req), NULL, NULL );
return &win->win;
@@ -1438,7 +1444,7 @@ int ioctl_set_window_parent( HWND hwnd, HWND parent )
req.hdr.hwnd = HandleToLong( hwnd );
req.hdr.opengl = FALSE;
- req.parent = HandleToLong( parent );
+ req.parent = get_ioctl_win_parent( parent );
return android_ioctl( IOCTL_SET_WINDOW_PARENT, &req, sizeof(req), NULL, NULL );
}
diff --git a/dlls/wineandroid.drv/window.c b/dlls/wineandroid.drv/window.c
index 3bfd0a8..5def81e 100644
--- a/dlls/wineandroid.drv/window.c
+++ b/dlls/wineandroid.drv/window.c
@@ -1018,34 +1018,11 @@ static struct android_win_data *create_win_data( HWND hwnd, const RECT *window_r
if (!(parent = GetAncestor( hwnd, GA_PARENT ))) return NULL; /* desktop or HWND_MESSAGE */
- if (parent != GetDesktopWindow())
- {
- if (!(data = get_win_data( parent )) &&
- !(data = create_win_data( parent, NULL, NULL )))
- return NULL;
- release_win_data( data );
- }
-
if (!(data = alloc_win_data( hwnd ))) return NULL;
data->parent = (parent == GetDesktopWindow()) ? 0 : parent;
-
- if (window_rect)
- {
- data->whole_rect = data->window_rect = *window_rect;
- data->client_rect = *client_rect;
- }
- else
- {
- GetWindowRect( hwnd, &data->window_rect );
- MapWindowPoints( 0, parent, (POINT *)&data->window_rect, 2 );
- data->whole_rect = data->window_rect;
- GetClientRect( hwnd, &data->client_rect );
- MapWindowPoints( hwnd, parent, (POINT *)&data->client_rect, 2 );
- ioctl_window_pos_changed( hwnd, &data->window_rect, &data->client_rect, &data->whole_rect,
- GetWindowLongW( hwnd, GWL_STYLE ), SWP_NOACTIVATE,
- GetWindow( hwnd, GW_HWNDPREV ), GetWindow( hwnd, GW_OWNER ));
- }
+ data->whole_rect = data->window_rect = *window_rect;
+ data->client_rect = *client_rect;
return data;
}
More information about the wine-cvs
mailing list