wineandroid: Also create HWND_MESSAGE windows on the Java side.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
cd2b41a2b4
commit
f39e021006
|
@ -62,6 +62,7 @@ public class WineActivity extends Activity
|
||||||
private ProgressDialog progress_dialog;
|
private ProgressDialog progress_dialog;
|
||||||
|
|
||||||
protected WineWindow desktop_window;
|
protected WineWindow desktop_window;
|
||||||
|
protected WineWindow message_window;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle savedInstanceState)
|
public void onCreate(Bundle savedInstanceState)
|
||||||
|
@ -290,6 +291,7 @@ private final void copyAssetFiles()
|
||||||
|
|
||||||
protected class WineWindow extends Object
|
protected class WineWindow extends Object
|
||||||
{
|
{
|
||||||
|
static protected final int HWND_MESSAGE = 0xfffffffd;
|
||||||
static protected final int WS_VISIBLE = 0x10000000;
|
static protected final int WS_VISIBLE = 0x10000000;
|
||||||
|
|
||||||
protected int hwnd;
|
protected int hwnd;
|
||||||
|
@ -617,6 +619,9 @@ public TopView( Context context, int hwnd )
|
||||||
desktop_window = new WineWindow( hwnd, null );
|
desktop_window = new WineWindow( hwnd, null );
|
||||||
addView( desktop_window.create_whole_view() );
|
addView( desktop_window.create_whole_view() );
|
||||||
desktop_window.client_group.bringToFront();
|
desktop_window.client_group.bringToFront();
|
||||||
|
|
||||||
|
message_window = new WineWindow( WineWindow.HWND_MESSAGE, null );
|
||||||
|
message_window.create_window_groups();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -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 );
|
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 )
|
static void wait_fence_and_close( int fence )
|
||||||
{
|
{
|
||||||
__s32 timeout = 1000; /* FIXME: should be -1 for infinite timeout */
|
__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 ioctl_android_create_window req;
|
||||||
struct native_win_wrapper *win = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*win) );
|
struct native_win_wrapper *win = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*win) );
|
||||||
HWND parent = GetAncestor( hwnd, GA_PARENT );
|
|
||||||
|
|
||||||
if (!win) return NULL;
|
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.hwnd = HandleToLong( win->hwnd );
|
||||||
req.hdr.opengl = win->opengl;
|
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 );
|
android_ioctl( IOCTL_CREATE_WINDOW, &req, sizeof(req), NULL, NULL );
|
||||||
|
|
||||||
return &win->win;
|
return &win->win;
|
||||||
|
@ -1438,7 +1444,7 @@ int ioctl_set_window_parent( HWND hwnd, HWND parent )
|
||||||
|
|
||||||
req.hdr.hwnd = HandleToLong( hwnd );
|
req.hdr.hwnd = HandleToLong( hwnd );
|
||||||
req.hdr.opengl = FALSE;
|
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 );
|
return android_ioctl( IOCTL_SET_WINDOW_PARENT, &req, sizeof(req), NULL, NULL );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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 = 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;
|
if (!(data = alloc_win_data( hwnd ))) return NULL;
|
||||||
|
|
||||||
data->parent = (parent == GetDesktopWindow()) ? 0 : parent;
|
data->parent = (parent == GetDesktopWindow()) ? 0 : parent;
|
||||||
|
data->whole_rect = data->window_rect = *window_rect;
|
||||||
if (window_rect)
|
data->client_rect = *client_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 ));
|
|
||||||
}
|
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue