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
e4cc5bf1
Commit
e4cc5bf1
authored
Jan 10, 2017
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winex11: Merge reading the selection data into the conversion function.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
dba1a78a
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
20 deletions
+18
-20
clipboard.c
dlls/winex11.drv/clipboard.c
+18
-20
No files found.
dlls/winex11.drv/clipboard.c
View file @
e4cc5bf1
...
...
@@ -133,7 +133,7 @@ static BOOL export_targets( Display *display, Window win, Atom prop, Atom target
static
BOOL
export_multiple
(
Display
*
display
,
Window
win
,
Atom
prop
,
Atom
target
,
HANDLE
handle
);
static
BOOL
export_timestamp
(
Display
*
display
,
Window
win
,
Atom
prop
,
Atom
target
,
HANDLE
handle
);
static
BOOL
X11DRV_CLIPBOARD_ReadP
roperty
(
Display
*
display
,
Window
w
,
Atom
prop
,
static
BOOL
read_p
roperty
(
Display
*
display
,
Window
w
,
Atom
prop
,
Atom
*
type
,
unsigned
char
**
data
,
unsigned
long
*
datasize
);
/* Clipboard formats */
...
...
@@ -435,22 +435,28 @@ static void put_property( Display *display, Window win, Atom prop, Atom type, in
/**************************************************************************
* convert_selection
*/
static
Atom
convert_selection
(
Display
*
display
,
Window
win
,
Atom
selection
,
Atom
target
)
static
BOOL
convert_selection
(
Display
*
display
,
Window
win
,
Atom
selection
,
struct
clipboard_format
*
format
,
Atom
*
type
,
unsigned
char
**
data
,
unsigned
long
*
size
)
{
int
i
;
XEvent
event
;
XConvertSelection
(
display
,
selection
,
target
,
x11drv_atom
(
SELECTION_DATA
),
win
,
CurrentTime
);
TRACE
(
"import %s from %s win %lx to format %s
\n
"
,
debugstr_xatom
(
format
->
atom
),
debugstr_xatom
(
selection
),
win
,
debugstr_format
(
format
->
id
)
);
XConvertSelection
(
display
,
selection
,
format
->
atom
,
x11drv_atom
(
SELECTION_DATA
),
win
,
CurrentTime
);
for
(
i
=
0
;
i
<
SELECTION_RETRIES
;
i
++
)
{
Bool
res
=
XCheckTypedWindowEvent
(
display
,
win
,
SelectionNotify
,
&
event
);
if
(
res
&&
event
.
xselection
.
selection
==
selection
&&
event
.
xselection
.
target
==
target
)
return
event
.
xselection
.
property
;
if
(
res
&&
event
.
xselection
.
selection
==
selection
&&
event
.
xselection
.
target
==
format
->
atom
)
return
read_property
(
display
,
win
,
event
.
xselection
.
property
,
type
,
data
,
size
)
;
usleep
(
SELECTION_WAIT
);
}
ERR
(
"Timed out waiting for SelectionNotify event
\n
"
);
return
None
;
return
FALSE
;
}
...
...
@@ -975,25 +981,16 @@ static HANDLE import_selection( Display *display, Window win, Atom selection,
{
unsigned
char
*
data
;
unsigned
long
size
;
Atom
prop
,
type
;
Atom
type
;
HANDLE
ret
;
if
(
!
format
->
import
)
return
0
;
TRACE
(
"import %s from %s win %lx to format %s
\n
"
,
debugstr_xatom
(
format
->
atom
),
debugstr_xatom
(
selection
),
win
,
debugstr_format
(
format
->
id
)
);
if
((
prop
=
convert_selection
(
display
,
win
,
selection
,
format
->
atom
))
==
None
)
if
(
!
convert_selection
(
display
,
win
,
selection
,
format
,
&
type
,
&
data
,
&
size
))
{
TRACE
(
"failed to convert selection
\n
"
);
return
0
;
}
if
(
!
X11DRV_CLIPBOARD_ReadProperty
(
display
,
win
,
prop
,
&
type
,
&
data
,
&
size
))
{
TRACE
(
"failed to read property
\n
"
);
return
0
;
}
ret
=
format
->
import
(
type
,
data
,
size
);
HeapFree
(
GetProcessHeap
(),
0
,
data
);
return
ret
;
...
...
@@ -1627,11 +1624,12 @@ struct clipboard_data_packet {
};
/**************************************************************************
* X11DRV_CLIPBOARD_ReadProperty
* read_property
*
* Reads the contents of the X selection property.
*/
static
BOOL
X11DRV_CLIPBOARD_ReadP
roperty
(
Display
*
display
,
Window
w
,
Atom
prop
,
Atom
*
type
,
unsigned
char
**
data
,
unsigned
long
*
datasize
)
static
BOOL
read_p
roperty
(
Display
*
display
,
Window
w
,
Atom
prop
,
Atom
*
type
,
unsigned
char
**
data
,
unsigned
long
*
datasize
)
{
XEvent
xe
;
...
...
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