Commit 86612073 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

wineandroid: Directly use win32u for user calls.

parent 6b8b9811
......@@ -312,7 +312,7 @@ static struct native_win_data *get_ioctl_native_win_data( const struct ioctl_hea
static int get_ioctl_win_parent( HWND parent )
{
if (parent != GetDesktopWindow() && !GetAncestor( parent, GA_PARENT ))
if (parent != NtUserGetDesktopWindow() && !NtUserGetAncestor( parent, GA_PARENT ))
return HandleToLong( HWND_MESSAGE );
return HandleToLong( parent );
}
......@@ -522,7 +522,7 @@ static void CALLBACK register_native_window_callback( ULONG_PTR arg1, ULONG_PTR
if (!data || data->parent == win)
{
pANativeWindow_release( win );
if (data) PostMessageW( hwnd, WM_ANDROID_REFRESH, opengl, 0 );
if (data) NtUserPostMessage( hwnd, WM_ANDROID_REFRESH, opengl, 0 );
TRACE( "%p -> %p win %p (unchanged)\n", hwnd, data, win );
return;
}
......@@ -535,7 +535,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, opengl, 0 );
NtUserPostMessage( hwnd, WM_ANDROID_REFRESH, opengl, 0 );
TRACE( "%p -> %p win %p\n", hwnd, data, win );
}
......@@ -1169,7 +1169,7 @@ static DWORD CALLBACK device_thread( void *arg )
init_java_thread( java_vm );
create_desktop_window( GetDesktopWindow() );
create_desktop_window( NtUserGetDesktopWindow() );
RtlInitUnicodeString( &nameW, driver_nameW );
if ((status = IoCreateDriver( &nameW, init_android_driver )))
......@@ -1559,7 +1559,7 @@ struct ANativeWindow *create_ioctl_window( HWND hwnd, BOOL opengl, float scale )
req.hdr.hwnd = HandleToLong( win->hwnd );
req.hdr.opengl = win->opengl;
req.parent = get_ioctl_win_parent( GetAncestor( hwnd, GA_PARENT ));
req.parent = get_ioctl_win_parent( NtUserGetAncestor( hwnd, GA_PARENT ));
req.scale = scale;
android_ioctl( IOCTL_CREATE_WINDOW, &req, sizeof(req), NULL, NULL );
......
......@@ -62,15 +62,19 @@ static const struct user_driver_funcs android_drv_funcs;
void init_monitors( int width, int height )
{
static const WCHAR trayW[] = {'S','h','e','l','l','_','T','r','a','y','W','n','d',0};
UNICODE_STRING name;
RECT rect;
HWND hwnd = FindWindowW( trayW, NULL );
HWND hwnd;
RtlInitUnicodeString( &name, trayW );
hwnd = NtUserFindWindowEx( 0, 0, &name, NULL, 0 );
virtual_screen_rect.right = width;
virtual_screen_rect.bottom = height;
monitor_rc_work = virtual_screen_rect;
if (!hwnd || !IsWindowVisible( hwnd )) return;
if (!GetWindowRect( hwnd, &rect )) return;
if (!hwnd || !NtUserIsWindowVisible( hwnd )) return;
if (!NtUserGetWindowRect( hwnd, &rect )) return;
if (rect.top) monitor_rc_work.bottom = rect.top;
else monitor_rc_work.top = rect.bottom;
TRACE( "found tray %p %s work area %s\n", hwnd,
......@@ -170,7 +174,7 @@ static void fetch_display_metrics(void)
SERVER_START_REQ( get_window_rectangles )
{
req->handle = wine_server_user_handle( GetDesktopWindow() );
req->handle = wine_server_user_handle( NtUserGetDesktopWindow() );
req->relative = COORDS_CLIENT;
if (!wine_server_call( req ))
{
......
......@@ -180,7 +180,7 @@ static BOOL refresh_context( struct wgl_context *ctx )
{
TRACE( "refreshing hwnd %p context %p surface %p\n", ctx->hwnd, ctx->context, ctx->surface );
p_eglMakeCurrent( display, ctx->surface, ctx->surface, ctx->context );
RedrawWindow( ctx->hwnd, NULL, 0, RDW_INVALIDATE | RDW_ERASE );
NtUserRedrawWindow( ctx->hwnd, NULL, 0, RDW_INVALIDATE | RDW_ERASE );
}
return ret;
}
......@@ -207,17 +207,17 @@ void update_gl_drawable( HWND hwnd )
}
}
release_gl_drawable( gl );
RedrawWindow( hwnd, NULL, 0, RDW_INVALIDATE | RDW_ERASE );
NtUserRedrawWindow( hwnd, NULL, 0, RDW_INVALIDATE | RDW_ERASE );
}
}
static BOOL set_pixel_format( HDC hdc, int format, BOOL allow_change )
{
struct gl_drawable *gl;
HWND hwnd = WindowFromDC( hdc );
HWND hwnd = NtUserWindowFromDC( hdc );
int prev = 0;
if (!hwnd || hwnd == GetDesktopWindow())
if (!hwnd || hwnd == NtUserGetDesktopWindow())
{
WARN( "not a proper window DC %p/%p\n", hdc, hwnd );
return FALSE;
......@@ -255,7 +255,7 @@ static struct wgl_context *create_context( HDC hdc, struct wgl_context *share, c
struct gl_drawable *gl;
struct wgl_context *ctx;
if (!(gl = get_gl_drawable( WindowFromDC( hdc ), hdc ))) return NULL;
if (!(gl = get_gl_drawable( NtUserWindowFromDC( hdc ), hdc ))) return NULL;
ctx = HeapAlloc( GetProcessHeap(), 0, sizeof(*ctx) );
......@@ -348,10 +348,10 @@ static BOOL android_wglMakeContextCurrentARB( HDC draw_hdc, HDC read_hdc, struct
return TRUE;
}
draw_hwnd = WindowFromDC( draw_hdc );
draw_hwnd = NtUserWindowFromDC( draw_hdc );
if ((draw_gl = get_gl_drawable( draw_hwnd, draw_hdc )))
{
read_gl = get_gl_drawable( WindowFromDC( read_hdc ), read_hdc );
read_gl = get_gl_drawable( NtUserWindowFromDC( read_hdc ), read_hdc );
draw_surface = draw_gl->surface ? draw_gl->surface : draw_gl->pbuffer;
read_surface = read_gl->surface ? read_gl->surface : read_gl->pbuffer;
TRACE( "%p/%p context %p surface %p/%p\n",
......@@ -500,7 +500,7 @@ static int WINAPI android_wglGetPixelFormat( HDC hdc )
struct gl_drawable *gl;
int ret = 0;
if ((gl = get_gl_drawable( WindowFromDC( hdc ), hdc )))
if ((gl = get_gl_drawable( NtUserWindowFromDC( hdc ), hdc )))
{
ret = gl->format;
/* offscreen formats can't be used with traditional WGL calls */
......@@ -540,7 +540,7 @@ static BOOL WINAPI android_wglMakeCurrent( HDC hdc, struct wgl_context *ctx )
return TRUE;
}
hwnd = WindowFromDC( hdc );
hwnd = NtUserWindowFromDC( hdc );
if ((gl = get_gl_drawable( hwnd, hdc )))
{
EGLSurface surface = gl->surface ? gl->surface : gl->pbuffer;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment