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
9dcc21e3
Commit
9dcc21e3
authored
Jan 14, 2013
by
Vincent Povirk
Committed by
Alexandre Julliard
Jan 15, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winex11.drv: Don't join INCR data until the transfer finishes.
parent
a71443a8
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
54 additions
and
14 deletions
+54
-14
clipboard.c
dlls/winex11.drv/clipboard.c
+54
-14
No files found.
dlls/winex11.drv/clipboard.c
View file @
9dcc21e3
...
@@ -2347,6 +2347,12 @@ static BOOL X11DRV_CLIPBOARD_GetProperty(Display *display, Window w, Atom prop,
...
@@ -2347,6 +2347,12 @@ static BOOL X11DRV_CLIPBOARD_GetProperty(Display *display, Window w, Atom prop,
}
}
struct
clipboard_data_packet
{
struct
list
entry
;
unsigned
long
size
;
unsigned
char
*
data
;
};
/**************************************************************************
/**************************************************************************
* X11DRV_CLIPBOARD_ReadProperty
* X11DRV_CLIPBOARD_ReadProperty
* Reads the contents of the X selection property.
* Reads the contents of the X selection property.
...
@@ -2368,13 +2374,21 @@ static BOOL X11DRV_CLIPBOARD_ReadProperty(Display *display, Window w, Atom prop,
...
@@ -2368,13 +2374,21 @@ static BOOL X11DRV_CLIPBOARD_ReadProperty(Display *display, Window w, Atom prop,
if
(
atype
==
x11drv_atom
(
INCR
))
if
(
atype
==
x11drv_atom
(
INCR
))
{
{
unsigned
char
*
buf
=
*
data
;
unsigned
char
*
buf
;
unsigned
long
bufsize
=
0
;
unsigned
long
bufsize
=
0
;
struct
list
packets
;
struct
clipboard_data_packet
*
packet
,
*
packet2
;
BOOL
res
;
HeapFree
(
GetProcessHeap
(),
0
,
*
data
);
*
data
=
NULL
;
list_init
(
&
packets
);
for
(;;)
for
(;;)
{
{
int
i
;
int
i
;
unsigned
char
*
prop_data
,
*
tmp
;
unsigned
char
*
prop_data
;
unsigned
long
prop_size
;
unsigned
long
prop_size
;
/* Wait until PropertyNotify is received */
/* Wait until PropertyNotify is received */
...
@@ -2392,32 +2406,58 @@ static BOOL X11DRV_CLIPBOARD_ReadProperty(Display *display, Window w, Atom prop,
...
@@ -2392,32 +2406,58 @@ static BOOL X11DRV_CLIPBOARD_ReadProperty(Display *display, Window w, Atom prop,
if
(
i
>=
SELECTION_RETRIES
||
if
(
i
>=
SELECTION_RETRIES
||
!
X11DRV_CLIPBOARD_GetProperty
(
display
,
w
,
prop
,
&
atype
,
&
prop_data
,
&
prop_size
))
!
X11DRV_CLIPBOARD_GetProperty
(
display
,
w
,
prop
,
&
atype
,
&
prop_data
,
&
prop_size
))
{
{
HeapFree
(
GetProcessHeap
(),
0
,
buf
)
;
res
=
FALSE
;
return
FALSE
;
break
;
}
}
/* Retrieved entire data. */
/* Retrieved entire data. */
if
(
prop_size
==
0
)
if
(
prop_size
==
0
)
{
{
HeapFree
(
GetProcessHeap
(),
0
,
prop_data
);
HeapFree
(
GetProcessHeap
(),
0
,
prop_data
);
*
data
=
buf
;
res
=
TRUE
;
*
datasize
=
bufsize
;
break
;
return
TRUE
;
}
}
tmp
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
buf
,
bufsize
+
prop_size
+
1
);
packet
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
packet
)
);
if
(
!
tmp
)
if
(
!
packet
)
{
{
HeapFree
(
GetProcessHeap
(),
0
,
buf
);
HeapFree
(
GetProcessHeap
(),
0
,
prop_data
);
HeapFree
(
GetProcessHeap
(),
0
,
prop_data
);
return
FALSE
;
res
=
FALSE
;
break
;
}
}
buf
=
tmp
;
packet
->
size
=
prop_size
;
memcpy
(
buf
+
bufsize
,
prop_data
,
prop_size
+
1
);
packet
->
data
=
prop_data
;
list_add_tail
(
&
packets
,
&
packet
->
entry
);
bufsize
+=
prop_size
;
bufsize
+=
prop_size
;
HeapFree
(
GetProcessHeap
(),
0
,
prop_data
);
}
}
if
(
res
)
{
buf
=
HeapAlloc
(
GetProcessHeap
(),
0
,
bufsize
+
1
);
if
(
buf
)
{
unsigned
long
bytes_copied
=
0
;
*
datasize
=
bufsize
;
LIST_FOR_EACH_ENTRY
(
packet
,
&
packets
,
struct
clipboard_data_packet
,
entry
)
{
memcpy
(
&
buf
[
bytes_copied
],
packet
->
data
,
packet
->
size
);
bytes_copied
+=
packet
->
size
;
}
buf
[
bufsize
]
=
0
;
*
data
=
buf
;
}
else
res
=
FALSE
;
}
LIST_FOR_EACH_ENTRY_SAFE
(
packet
,
packet2
,
&
packets
,
struct
clipboard_data_packet
,
entry
)
{
HeapFree
(
GetProcessHeap
(),
0
,
packet
->
data
);
HeapFree
(
GetProcessHeap
(),
0
,
packet
);
}
return
res
;
}
}
return
TRUE
;
return
TRUE
;
...
...
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