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
6f825503
Commit
6f825503
authored
May 31, 2022
by
Jacek Caban
Committed by
Alexandre Julliard
May 31, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winex11: Use ClipboardWindowProc driver entry point for clipboard manager.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
parent
d8a74e5c
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
9 additions
and
126 deletions
+9
-126
clipboard.c
dlls/winex11.drv/clipboard.c
+7
-10
dllmain.c
dlls/winex11.drv/dllmain.c
+0
-102
init.c
dlls/winex11.drv/init.c
+1
-0
unixlib.h
dlls/winex11.drv/unixlib.h
+0
-11
window.c
dlls/winex11.drv/window.c
+0
-1
x11drv.h
dlls/winex11.drv/x11drv.h
+1
-1
x11drv_main.c
dlls/winex11.drv/x11drv_main.c
+0
-1
No files found.
dlls/winex11.drv/clipboard.c
View file @
6f825503
...
...
@@ -2215,7 +2215,7 @@ static void xfixes_init(void)
/**************************************************************************
* clipboard_
thread
* clipboard_
init
*
* Thread running inside the desktop process to manage the clipboard
*/
...
...
@@ -2250,20 +2250,18 @@ static BOOL clipboard_init( HWND hwnd )
/**************************************************************************
* x11drv_clipboard_message
*/
NTSTATUS
x11drv_clipboard_message
(
void
*
arg
)
LRESULT
X11DRV_ClipboardWindowProc
(
HWND
hwnd
,
UINT
msg
,
WPARAM
wparam
,
LPARAM
lparam
)
{
struct
clipboard_message_params
*
params
=
arg
;
switch
(
params
->
msg
)
switch
(
msg
)
{
case
WM_NCCREATE
:
return
clipboard_init
(
params
->
hwnd
);
return
clipboard_init
(
hwnd
);
case
WM_CLIPBOARDUPDATE
:
if
(
is_clipboard_owner
)
break
;
/* ignore our own changes */
acquire_selection
(
thread_init_display
()
);
break
;
case
WM_RENDERFORMAT
:
if
(
render_format
(
params
->
wparam
))
rendered_formats
++
;
if
(
render_format
(
wparam
))
rendered_formats
++
;
break
;
case
WM_TIMER
:
if
(
!
is_clipboard_owner
)
break
;
...
...
@@ -2272,12 +2270,11 @@ NTSTATUS x11drv_clipboard_message( void *arg )
case
WM_DESTROYCLIPBOARD
:
TRACE
(
"WM_DESTROYCLIPBOARD: lost ownership
\n
"
);
is_clipboard_owner
=
FALSE
;
NtUserKillTimer
(
params
->
hwnd
,
1
);
NtUserKillTimer
(
hwnd
,
1
);
break
;
}
return
NtUserMessageCall
(
params
->
hwnd
,
params
->
msg
,
params
->
wparam
,
params
->
lparam
,
NULL
,
NtUserDefWindowProc
,
FALSE
);
return
NtUserMessageCall
(
hwnd
,
msg
,
wparam
,
lparam
,
NULL
,
NtUserDefWindowProc
,
FALSE
);
}
...
...
dlls/winex11.drv/dllmain.c
View file @
6f825503
...
...
@@ -21,112 +21,11 @@
#include "x11drv_dll.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
x11drv
);
HMODULE
x11drv_module
=
0
;
static
unixlib_handle_t
x11drv_handle
;
NTSTATUS
(
CDECL
*
x11drv_unix_call
)(
enum
x11drv_funcs
code
,
void
*
params
);
/**************************************************************************
* wait_clipboard_mutex
*
* Make sure that there's only one clipboard thread per window station.
*/
static
BOOL
wait_clipboard_mutex
(
void
)
{
static
const
WCHAR
prefix
[]
=
{
'_'
,
'_'
,
'w'
,
'i'
,
'n'
,
'e'
,
'_'
,
'c'
,
'l'
,
'i'
,
'p'
,
'b'
,
'o'
,
'a'
,
'r'
,
'd'
,
'_'
};
WCHAR
buffer
[
MAX_PATH
+
ARRAY_SIZE
(
prefix
)];
HANDLE
mutex
;
memcpy
(
buffer
,
prefix
,
sizeof
(
prefix
)
);
if
(
!
GetUserObjectInformationW
(
GetProcessWindowStation
(),
UOI_NAME
,
buffer
+
ARRAY_SIZE
(
prefix
),
sizeof
(
buffer
)
-
sizeof
(
prefix
),
NULL
))
{
ERR
(
"failed to get winstation name
\n
"
);
return
FALSE
;
}
mutex
=
CreateMutexW
(
NULL
,
TRUE
,
buffer
);
if
(
GetLastError
()
==
ERROR_ALREADY_EXISTS
)
{
TRACE
(
"waiting for mutex %s
\n
"
,
debugstr_w
(
buffer
));
WaitForSingleObject
(
mutex
,
INFINITE
);
}
return
TRUE
;
}
/**************************************************************************
* clipboard_wndproc
*
* Window procedure for the clipboard manager.
*/
static
LRESULT
CALLBACK
clipboard_wndproc
(
HWND
hwnd
,
UINT
msg
,
WPARAM
wp
,
LPARAM
lp
)
{
struct
clipboard_message_params
params
;
switch
(
msg
)
{
case
WM_NCCREATE
:
case
WM_CLIPBOARDUPDATE
:
case
WM_RENDERFORMAT
:
case
WM_TIMER
:
case
WM_DESTROYCLIPBOARD
:
params
.
hwnd
=
hwnd
;
params
.
msg
=
msg
;
params
.
wparam
=
wp
;
params
.
lparam
=
lp
;
return
X11DRV_CALL
(
clipboard_message
,
&
params
);
}
return
DefWindowProcW
(
hwnd
,
msg
,
wp
,
lp
);
}
/**************************************************************************
* clipboard_thread
*
* Thread running inside the desktop process to manage the clipboard
*/
static
DWORD
WINAPI
clipboard_thread
(
void
*
arg
)
{
static
const
WCHAR
clipboard_classname
[]
=
{
'_'
,
'_'
,
'w'
,
'i'
,
'n'
,
'e'
,
'_'
,
'c'
,
'l'
,
'i'
,
'p'
,
'b'
,
'o'
,
'a'
,
'r'
,
'd'
,
'_'
,
'm'
,
'a'
,
'n'
,
'a'
,
'g'
,
'e'
,
'r'
,
0
};
WNDCLASSW
class
;
MSG
msg
;
if
(
!
wait_clipboard_mutex
())
return
0
;
memset
(
&
class
,
0
,
sizeof
(
class
)
);
class
.
lpfnWndProc
=
clipboard_wndproc
;
class
.
lpszClassName
=
clipboard_classname
;
if
(
!
RegisterClassW
(
&
class
)
&&
GetLastError
()
!=
ERROR_CLASS_ALREADY_EXISTS
)
{
ERR
(
"could not register clipboard window class err %u
\n
"
,
GetLastError
()
);
return
0
;
}
if
(
!
CreateWindowW
(
clipboard_classname
,
NULL
,
0
,
0
,
0
,
0
,
0
,
HWND_MESSAGE
,
0
,
0
,
NULL
))
{
ERR
(
"failed to create clipboard window err %u
\n
"
,
GetLastError
()
);
return
0
;
}
while
(
GetMessageW
(
&
msg
,
0
,
0
,
0
))
DispatchMessageW
(
&
msg
);
return
0
;
}
static
NTSTATUS
x11drv_clipboard_init
(
UINT
arg
)
{
DWORD
id
;
HANDLE
thread
=
CreateThread
(
NULL
,
0
,
clipboard_thread
,
NULL
,
0
,
&
id
);
if
(
thread
)
CloseHandle
(
thread
);
else
ERR
(
"failed to create clipboard thread
\n
"
);
return
0
;
}
static
NTSTATUS
x11drv_load_icon
(
UINT
id
)
{
...
...
@@ -137,7 +36,6 @@ static NTSTATUS x11drv_load_icon( UINT id )
typedef
NTSTATUS
(
*
callback_func
)(
UINT
arg
);
static
const
callback_func
callback_funcs
[]
=
{
x11drv_clipboard_init
,
x11drv_dnd_drop_event
,
x11drv_dnd_leave_event
,
x11drv_ime_get_cursor_pos
,
...
...
dlls/winex11.drv/init.c
View file @
6f825503
...
...
@@ -425,6 +425,7 @@ static const struct user_driver_funcs x11drv_funcs =
.
pSetWindowText
=
X11DRV_SetWindowText
,
.
pShowWindow
=
X11DRV_ShowWindow
,
.
pSysCommand
=
X11DRV_SysCommand
,
.
pClipboardWindowProc
=
X11DRV_ClipboardWindowProc
,
.
pUpdateClipboard
=
X11DRV_UpdateClipboard
,
.
pUpdateLayeredWindow
=
X11DRV_UpdateLayeredWindow
,
.
pWindowMessage
=
X11DRV_WindowMessage
,
...
...
dlls/winex11.drv/unixlib.h
View file @
6f825503
...
...
@@ -21,7 +21,6 @@
enum
x11drv_funcs
{
unix_clipboard_message
,
unix_create_desktop
,
unix_init
,
unix_systray_clear
,
...
...
@@ -41,15 +40,6 @@ enum x11drv_funcs
extern
NTSTATUS
(
CDECL
*
x11drv_unix_call
)(
enum
x11drv_funcs
code
,
void
*
params
)
DECLSPEC_HIDDEN
;
#define X11DRV_CALL(func, params) x11drv_unix_call( unix_ ## func, params )
/* x11drv_clipboard_message params */
struct
clipboard_message_params
{
HWND
hwnd
;
UINT
msg
;
WPARAM
wparam
;
LPARAM
lparam
;
};
/* x11drv_create_desktop params */
struct
create_desktop_params
{
...
...
@@ -108,7 +98,6 @@ C_ASSERT( client_func_last <= NtUserDriverCallbackLast + 1 );
/* simplified interface for client callbacks requiring only a single UINT parameter */
enum
client_callback
{
client_clipboard_init
,
client_dnd_drop_event
,
client_dnd_leave_event
,
client_ime_get_cursor_pos
,
...
...
dlls/winex11.drv/window.c
View file @
6f825503
...
...
@@ -1913,7 +1913,6 @@ BOOL X11DRV_CreateWindow( HWND hwnd )
CWOverrideRedirect
|
CWEventMask
,
&
attr
);
XFlush
(
data
->
display
);
NtUserSetProp
(
hwnd
,
clip_window_prop
,
(
HANDLE
)
data
->
clip_window
);
x11drv_client_call
(
client_clipboard_init
,
0
);
X11DRV_DisplayDevices_RegisterEventHandlers
();
}
return
TRUE
;
...
...
dlls/winex11.drv/x11drv.h
View file @
6f825503
...
...
@@ -238,6 +238,7 @@ extern void X11DRV_SetWindowStyle( HWND hwnd, INT offset, STYLESTRUCT *style ) D
extern
void
X11DRV_SetWindowText
(
HWND
hwnd
,
LPCWSTR
text
)
DECLSPEC_HIDDEN
;
extern
UINT
X11DRV_ShowWindow
(
HWND
hwnd
,
INT
cmd
,
RECT
*
rect
,
UINT
swp
)
DECLSPEC_HIDDEN
;
extern
LRESULT
X11DRV_SysCommand
(
HWND
hwnd
,
WPARAM
wparam
,
LPARAM
lparam
)
DECLSPEC_HIDDEN
;
extern
LRESULT
X11DRV_ClipboardWindowProc
(
HWND
hwnd
,
UINT
msg
,
WPARAM
wp
,
LPARAM
lp
)
DECLSPEC_HIDDEN
;
extern
void
X11DRV_UpdateClipboard
(
void
)
DECLSPEC_HIDDEN
;
extern
BOOL
X11DRV_UpdateLayeredWindow
(
HWND
hwnd
,
const
UPDATELAYEREDWINDOWINFO
*
info
,
const
RECT
*
window_rect
)
DECLSPEC_HIDDEN
;
...
...
@@ -833,7 +834,6 @@ static inline BOOL is_window_rect_mapped( const RECT *rect )
/* unixlib interface */
extern
NTSTATUS
x11drv_clipboard_message
(
void
*
arg
)
DECLSPEC_HIDDEN
;
extern
NTSTATUS
x11drv_create_desktop
(
void
*
arg
)
DECLSPEC_HIDDEN
;
extern
NTSTATUS
x11drv_systray_clear
(
void
*
arg
)
DECLSPEC_HIDDEN
;
extern
NTSTATUS
x11drv_systray_dock
(
void
*
arg
)
DECLSPEC_HIDDEN
;
...
...
dlls/winex11.drv/x11drv_main.c
View file @
6f825503
...
...
@@ -1302,7 +1302,6 @@ NTSTATUS x11drv_client_call( enum client_callback func, UINT arg )
const
unixlib_entry_t
__wine_unix_call_funcs
[]
=
{
x11drv_clipboard_message
,
x11drv_create_desktop
,
x11drv_init
,
x11drv_systray_clear
,
...
...
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