Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
2b8021d4
Commit
2b8021d4
authored
Sep 01, 2016
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: Don't release the clipboard owner window when the owner thread terminates.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
bddab0e7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
1 deletion
+19
-1
clipboard.c
dlls/user32/tests/clipboard.c
+18
-0
clipboard.c
server/clipboard.c
+1
-1
No files found.
dlls/user32/tests/clipboard.c
View file @
2b8021d4
...
...
@@ -57,6 +57,14 @@ static DWORD WINAPI open_and_empty_clipboard_thread(LPVOID arg)
return
0
;
}
static
DWORD
WINAPI
open_and_empty_clipboard_win_thread
(
LPVOID
arg
)
{
HWND
hwnd
=
CreateWindowA
(
"static"
,
NULL
,
WS_POPUP
,
0
,
0
,
10
,
10
,
0
,
0
,
0
,
NULL
);
ok
(
OpenClipboard
(
hwnd
),
"%u: OpenClipboard failed
\n
"
,
thread_from_line
);
ok
(
EmptyClipboard
(),
"%u: EmptyClipboard failed
\n
"
,
thread_from_line
);
return
0
;
}
static
DWORD
WINAPI
set_clipboard_data_thread
(
LPVOID
arg
)
{
HWND
hwnd
=
arg
;
...
...
@@ -329,6 +337,8 @@ static void test_ClipboardOwner(void)
ok
(
ret
,
"CloseClipboard error %d
\n
"
,
GetLastError
());
run_thread
(
open_and_empty_clipboard_thread
,
0
,
__LINE__
);
ok
(
!
GetOpenClipboardWindow
(),
"wrong open window %p
\n
"
,
GetOpenClipboardWindow
()
);
ok
(
!
GetClipboardOwner
(),
"wrong owner window %p
\n
"
,
GetClipboardOwner
()
);
ret
=
OpenClipboard
(
0
);
ok
(
ret
,
"OpenClipboard error %d
\n
"
,
GetLastError
());
...
...
@@ -347,6 +357,14 @@ static void test_ClipboardOwner(void)
ok
(
GetLastError
()
==
ERROR_CLIPBOARD_NOT_OPEN
,
"wrong error %u
\n
"
,
GetLastError
()
);
ok
(
!
IsClipboardFormatAvailable
(
CF_WAVE
),
"SetClipboardData succeeded
\n
"
);
run_thread
(
open_and_empty_clipboard_thread
,
GetDesktopWindow
(),
__LINE__
);
ok
(
!
GetOpenClipboardWindow
(),
"wrong open window %p
\n
"
,
GetOpenClipboardWindow
()
);
ok
(
GetClipboardOwner
()
==
GetDesktopWindow
(),
"wrong owner window %p / %p
\n
"
,
GetClipboardOwner
(),
GetDesktopWindow
()
);
run_thread
(
open_and_empty_clipboard_win_thread
,
0
,
__LINE__
);
ok
(
!
GetOpenClipboardWindow
(),
"wrong open window %p
\n
"
,
GetOpenClipboardWindow
()
);
ok
(
!
GetClipboardOwner
(),
"wrong owner window %p
\n
"
,
GetClipboardOwner
()
);
}
static
void
test_RegisterClipboardFormatA
(
void
)
...
...
server/clipboard.c
View file @
2b8021d4
...
...
@@ -220,7 +220,7 @@ void cleanup_clipboard_thread(struct thread *thread)
if
((
clipboard
=
winstation
->
clipboard
))
{
if
(
thread
==
clipboard
->
owner_thread
)
release_clipboard
(
clipboard
)
;
if
(
thread
==
clipboard
->
owner_thread
)
clipboard
->
owner_thread
=
NULL
;
if
(
thread
==
clipboard
->
open_thread
)
{
user_handle_t
viewer
=
close_clipboard
(
clipboard
);
...
...
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