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
5962df3a
Commit
5962df3a
authored
Aug 23, 2016
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: Cleanup clipboard information upon window destruction.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
43e38153
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
4 deletions
+25
-4
clipboard.c
dlls/user32/tests/clipboard.c
+4
-4
clipboard.c
server/clipboard.c
+19
-0
user.h
server/user.h
+1
-0
window.c
server/window.c
+1
-0
No files found.
dlls/user32/tests/clipboard.c
View file @
5962df3a
...
@@ -266,13 +266,13 @@ static void test_ClipboardOwner(void)
...
@@ -266,13 +266,13 @@ static void test_ClipboardOwner(void)
ok
(
ret
,
"DestroyWindow error %d
\n
"
,
GetLastError
());
ok
(
ret
,
"DestroyWindow error %d
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
ok
(
!
GetClipboardOwner
()
&&
GetLastError
()
==
0xdeadbeef
,
"clipboard should not be owned
\n
"
);
ok
(
!
GetClipboardOwner
()
&&
GetLastError
()
==
0xdeadbeef
,
"clipboard should not be owned
\n
"
);
todo_wine
ok
(
!
GetClipboardViewer
()
&&
GetLastError
()
==
0xdeadbeef
,
"viewer still exists
\n
"
);
ok
(
!
GetClipboardViewer
()
&&
GetLastError
()
==
0xdeadbeef
,
"viewer still exists
\n
"
);
todo_wine
ok
(
!
GetOpenClipboardWindow
()
&&
GetLastError
()
==
0xdeadbeef
,
"clipboard should not be open
\n
"
);
ok
(
!
GetOpenClipboardWindow
()
&&
GetLastError
()
==
0xdeadbeef
,
"clipboard should not be open
\n
"
);
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
ret
=
CloseClipboard
();
ret
=
CloseClipboard
();
todo_wine
ok
(
!
ret
,
"CloseClipboard succeeded
\n
"
);
ok
(
!
ret
,
"CloseClipboard succeeded
\n
"
);
todo_wine
ok
(
GetLastError
()
==
ERROR_CLIPBOARD_NOT_OPEN
,
"wrong error %u
\n
"
,
GetLastError
()
);
ok
(
GetLastError
()
==
ERROR_CLIPBOARD_NOT_OPEN
,
"wrong error %u
\n
"
,
GetLastError
()
);
ret
=
OpenClipboard
(
0
);
ret
=
OpenClipboard
(
0
);
ok
(
ret
,
"OpenClipboard error %d
\n
"
,
GetLastError
());
ok
(
ret
,
"OpenClipboard error %d
\n
"
,
GetLastError
());
...
...
server/clipboard.c
View file @
5962df3a
...
@@ -111,6 +111,25 @@ static struct clipboard *get_process_clipboard(void)
...
@@ -111,6 +111,25 @@ static struct clipboard *get_process_clipboard(void)
return
clipboard
;
return
clipboard
;
}
}
/* cleanup clipboard information upon window destruction */
void
cleanup_clipboard_window
(
struct
desktop
*
desktop
,
user_handle_t
window
)
{
struct
clipboard
*
clipboard
=
desktop
->
winstation
->
clipboard
;
if
(
!
clipboard
)
return
;
if
(
clipboard
->
open_win
==
window
)
{
clipboard
->
open_win
=
0
;
clipboard
->
open_thread
=
NULL
;
}
if
(
clipboard
->
owner_win
==
window
)
{
clipboard
->
owner_win
=
0
;
clipboard
->
owner_thread
=
NULL
;
}
if
(
clipboard
->
viewer
==
window
)
clipboard
->
viewer
=
0
;
}
/* Called when thread terminates to allow release of clipboard */
/* Called when thread terminates to allow release of clipboard */
void
cleanup_clipboard_thread
(
struct
thread
*
thread
)
void
cleanup_clipboard_thread
(
struct
thread
*
thread
)
...
...
server/user.h
View file @
5962df3a
...
@@ -91,6 +91,7 @@ extern void free_process_user_handles( struct process *process );
...
@@ -91,6 +91,7 @@ extern void free_process_user_handles( struct process *process );
/* clipboard functions */
/* clipboard functions */
extern
void
cleanup_clipboard_window
(
struct
desktop
*
desktop
,
user_handle_t
window
);
extern
void
cleanup_clipboard_thread
(
struct
thread
*
thread
);
extern
void
cleanup_clipboard_thread
(
struct
thread
*
thread
);
/* hook functions */
/* hook functions */
...
...
server/window.c
View file @
5962df3a
...
@@ -1855,6 +1855,7 @@ void destroy_window( struct window *win )
...
@@ -1855,6 +1855,7 @@ void destroy_window( struct window *win )
if
(
win
==
progman_window
)
progman_window
=
NULL
;
if
(
win
==
progman_window
)
progman_window
=
NULL
;
if
(
win
==
taskman_window
)
taskman_window
=
NULL
;
if
(
win
==
taskman_window
)
taskman_window
=
NULL
;
free_hotkeys
(
win
->
desktop
,
win
->
handle
);
free_hotkeys
(
win
->
desktop
,
win
->
handle
);
cleanup_clipboard_window
(
win
->
desktop
,
win
->
handle
);
free_user_handle
(
win
->
handle
);
free_user_handle
(
win
->
handle
);
destroy_properties
(
win
);
destroy_properties
(
win
);
list_remove
(
&
win
->
entry
);
list_remove
(
&
win
->
entry
);
...
...
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