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
df9ff687
Commit
df9ff687
authored
Sep 23, 2016
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winex11: If multiple clipboard formats can be exported, use the first available one.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
cc7abfdf
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
17 deletions
+27
-17
clipboard.c
dlls/winex11.drv/clipboard.c
+27
-17
No files found.
dlls/winex11.drv/clipboard.c
View file @
df9ff687
...
...
@@ -1793,27 +1793,37 @@ static BOOL export_targets( Display *display, Window win, Atom prop, Atom target
*/
static
BOOL
export_selection
(
Display
*
display
,
Window
win
,
Atom
prop
,
Atom
target
)
{
struct
clipboard_format
*
format
=
X11DRV_CLIPBOARD_LookupProperty
(
NULL
,
target
)
;
struct
clipboard_format
*
format
;
HANDLE
handle
=
0
;
BOOL
ret
=
FALSE
;
if
(
!
format
||
!
format
->
export
)
return
FALSE
;
TRACE
(
"win %lx prop %s target %s exporting %s
\n
"
,
win
,
debugstr_xatom
(
prop
),
debugstr_xatom
(
target
),
debugstr_format
(
format
->
id
)
);
if
(
!
format
->
id
)
return
format
->
export
(
display
,
win
,
prop
,
target
,
0
);
BOOL
open
=
FALSE
,
ret
=
FALSE
;
if
(
!
OpenClipboard
(
0
)
)
LIST_FOR_EACH_ENTRY
(
format
,
&
format_list
,
struct
clipboard_format
,
entry
)
{
ERR
(
"failed to open clipboard for %s
\n
"
,
debugstr_format
(
format
->
id
));
return
FALSE
;
}
if
((
handle
=
GetClipboardData
(
format
->
id
)))
ret
=
format
->
export
(
display
,
win
,
prop
,
target
,
handle
);
if
(
format
->
atom
!=
target
)
continue
;
if
(
!
format
->
export
)
continue
;
if
(
!
format
->
id
)
{
TRACE
(
"win %lx prop %s target %s
\n
"
,
win
,
debugstr_xatom
(
prop
),
debugstr_xatom
(
target
));
ret
=
format
->
export
(
display
,
win
,
prop
,
target
,
0
);
break
;
}
if
(
!
open
&&
!
(
open
=
OpenClipboard
(
0
)))
{
ERR
(
"failed to open clipboard for %s
\n
"
,
debugstr_xatom
(
target
));
return
FALSE
;
}
if
((
handle
=
GetClipboardData
(
format
->
id
)))
{
TRACE
(
"win %lx prop %s target %s exporting %s %p
\n
"
,
win
,
debugstr_xatom
(
prop
),
debugstr_xatom
(
target
),
debugstr_format
(
format
->
id
),
handle
);
CloseClipboard
();
ret
=
format
->
export
(
display
,
win
,
prop
,
target
,
handle
);
break
;
}
/* keep looking for another Win32 format mapping to the same target */
}
if
(
open
)
CloseClipboard
();
return
ret
;
}
...
...
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