Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
86612073
Commit
86612073
authored
Jun 04, 2022
by
Jacek Caban
Committed by
Alexandre Julliard
Jun 06, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wineandroid: Directly use win32u for user calls.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
parent
6b8b9811
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
78 additions
and
49 deletions
+78
-49
device.c
dlls/wineandroid.drv/device.c
+5
-5
init.c
dlls/wineandroid.drv/init.c
+8
-4
opengl.c
dlls/wineandroid.drv/opengl.c
+9
-9
window.c
dlls/wineandroid.drv/window.c
+56
-31
No files found.
dlls/wineandroid.drv/device.c
View file @
86612073
...
...
@@ -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
()
&&
!
NtUser
GetAncestor
(
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
(
NtUser
GetDesktopWindow
()
);
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
(
NtUser
GetAncestor
(
hwnd
,
GA_PARENT
));
req
.
scale
=
scale
;
android_ioctl
(
IOCTL_CREATE_WINDOW
,
&
req
,
sizeof
(
req
),
NULL
,
NULL
);
...
...
dlls/wineandroid.drv/init.c
View file @
86612073
...
...
@@ -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
||
!
NtUser
IsWindowVisible
(
hwnd
))
return
;
if
(
!
NtUser
GetWindowRect
(
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
(
NtUser
GetDesktopWindow
()
);
req
->
relative
=
COORDS_CLIENT
;
if
(
!
wine_server_call
(
req
))
{
...
...
dlls/wineandroid.drv/opengl.c
View file @
86612073
...
...
@@ -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
);
NtUser
RedrawWindow
(
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
);
NtUser
RedrawWindow
(
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
=
NtUser
WindowFromDC
(
hdc
);
int
prev
=
0
;
if
(
!
hwnd
||
hwnd
==
GetDesktopWindow
())
if
(
!
hwnd
||
hwnd
==
NtUser
GetDesktopWindow
())
{
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
(
NtUser
WindowFromDC
(
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
=
NtUser
WindowFromDC
(
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
(
NtUser
WindowFromDC
(
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
(
NtUser
WindowFromDC
(
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
=
NtUser
WindowFromDC
(
hdc
);
if
((
gl
=
get_gl_drawable
(
hwnd
,
hdc
)))
{
EGLSurface
surface
=
gl
->
surface
?
gl
->
surface
:
gl
->
pbuffer
;
...
...
dlls/wineandroid.drv/window.c
View file @
86612073
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment