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
e02c2f82
Commit
e02c2f82
authored
May 01, 2022
by
Jacek Caban
Committed by
Alexandre Julliard
May 03, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winex11: Reimplement EVENT_DropFromOffiX using get_dos_file_name.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
30e17220
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
64 additions
and
38 deletions
+64
-38
clipboard.c
dlls/winex11.drv/clipboard.c
+52
-0
event.c
dlls/winex11.drv/event.c
+11
-38
x11drv.h
dlls/winex11.drv/x11drv.h
+1
-0
No files found.
dlls/winex11.drv/clipboard.c
View file @
e02c2f82
...
...
@@ -1043,6 +1043,58 @@ static void *import_text_html( Atom type, const void *data, size_t size, size_t
/**************************************************************************
* file_list_to_drop_files
*/
void
*
file_list_to_drop_files
(
const
void
*
data
,
size_t
size
,
size_t
*
ret_size
)
{
size_t
buf_size
=
4096
,
path_size
;
DROPFILES
*
drop
=
NULL
;
const
char
*
ptr
;
WCHAR
*
path
;
for
(
ptr
=
data
;
ptr
<
(
const
char
*
)
data
+
size
;
ptr
+=
strlen
(
ptr
)
+
1
)
{
path
=
get_dos_file_name
(
ptr
);
TRACE
(
"converted URI %s to DOS path %s
\n
"
,
debugstr_a
(
ptr
),
debugstr_w
(
path
)
);
if
(
!
path
)
continue
;
if
(
!
drop
)
{
if
(
!
(
drop
=
malloc
(
buf_size
)))
return
NULL
;
drop
->
pFiles
=
sizeof
(
*
drop
);
drop
->
pt
.
x
=
drop
->
pt
.
y
=
0
;
drop
->
fNC
=
FALSE
;
drop
->
fWide
=
TRUE
;
*
ret_size
=
sizeof
(
*
drop
);
}
path_size
=
(
lstrlenW
(
path
)
+
1
)
*
sizeof
(
WCHAR
);
if
(
*
ret_size
+
path_size
>
buf_size
-
sizeof
(
WCHAR
))
{
void
*
new_buf
;
if
(
!
(
new_buf
=
realloc
(
drop
,
buf_size
*
2
+
path_size
)))
{
free
(
path
);
continue
;
}
buf_size
=
buf_size
*
2
+
path_size
;
drop
=
new_buf
;
}
memcpy
(
(
char
*
)
drop
+
*
ret_size
,
path
,
path_size
);
*
ret_size
+=
path_size
;
}
if
(
!
drop
)
return
NULL
;
*
(
WCHAR
*
)((
char
*
)
drop
+
*
ret_size
)
=
0
;
*
ret_size
+=
sizeof
(
WCHAR
);
return
drop
;
}
/**************************************************************************
* uri_list_to_drop_files
*/
void
*
uri_list_to_drop_files
(
const
void
*
data
,
size_t
size
,
size_t
*
ret_size
)
...
...
dlls/winex11.drv/event.c
View file @
e02c2f82
...
...
@@ -1503,7 +1503,7 @@ static void EVENT_DropFromOffiX( HWND hWnd, XClientMessageEvent *event )
unsigned
long
aux_long
;
unsigned
char
*
p_data
=
NULL
;
Atom
atom_aux
;
int
x
,
y
,
cx
,
cy
,
dummy
;
int
x
,
y
,
cx
,
cy
,
dummy
,
format
;
Window
win
,
w_aux_root
,
w_aux_child
;
if
(
!
(
data
=
get_win_data
(
hWnd
)))
return
;
...
...
@@ -1529,50 +1529,23 @@ static void EVENT_DropFromOffiX( HWND hWnd, XClientMessageEvent *event )
XGetWindowProperty
(
event
->
display
,
DefaultRootWindow
(
event
->
display
),
x11drv_atom
(
DndSelection
),
0
,
65535
,
FALSE
,
AnyPropertyType
,
&
atom_aux
,
&
dummy
,
AnyPropertyType
,
&
atom_aux
,
&
format
,
&
data_length
,
&
aux_long
,
&
p_data
);
if
(
!
aux_long
&&
p_data
)
/* don't bother if > 64K */
if
(
!
aux_long
&&
p_data
)
/* don't bother if > 64K */
{
char
*
p
=
(
char
*
)
p_data
;
char
*
p_drop
;
DROPFILES
*
drop
;
size_t
drop_size
;
aux_long
=
0
;
while
(
*
p
)
/* calculate buffer size */
drop
=
file_list_to_drop_files
(
p_data
,
get_property_size
(
format
,
data_length
),
&
drop_size
)
;
if
(
drop
)
{
INT
len
=
GetShortPathNameA
(
p
,
NULL
,
0
);
if
(
len
)
aux_long
+=
len
+
1
;
p
+=
strlen
(
p
)
+
1
;
}
if
(
aux_long
&&
aux_long
<
65535
)
{
HDROP
hDrop
;
DROPFILES
*
lpDrop
;
aux_long
+=
sizeof
(
DROPFILES
)
+
1
;
hDrop
=
GlobalAlloc
(
GMEM_SHARE
,
aux_long
);
lpDrop
=
GlobalLock
(
hDrop
);
if
(
lpDrop
)
{
lpDrop
->
pFiles
=
sizeof
(
DROPFILES
);
lpDrop
->
pt
=
pt
;
lpDrop
->
fNC
=
FALSE
;
lpDrop
->
fWide
=
FALSE
;
p_drop
=
(
char
*
)(
lpDrop
+
1
);
p
=
(
char
*
)
p_data
;
while
(
*
p
)
{
if
(
GetShortPathNameA
(
p
,
p_drop
,
aux_long
-
(
p_drop
-
(
char
*
)
lpDrop
)
))
p_drop
+=
strlen
(
p_drop
)
+
1
;
p
+=
strlen
(
p
)
+
1
;
}
*
p_drop
=
'\0'
;
PostMessageA
(
hWnd
,
WM_DROPFILES
,
(
WPARAM
)
hDrop
,
0L
);
}
post_drop
(
hWnd
,
drop
,
drop_size
);
free
(
drop
);
}
}
if
(
p_data
)
XFree
(
p_data
);
if
(
p_data
)
XFree
(
p_data
);
}
/**********************************************************************
...
...
dlls/winex11.drv/x11drv.h
View file @
e02c2f82
...
...
@@ -661,6 +661,7 @@ extern void update_systray_balloon_position(void) DECLSPEC_HIDDEN;
extern
HWND
create_foreign_window
(
Display
*
display
,
Window
window
)
DECLSPEC_HIDDEN
;
extern
BOOL
update_clipboard
(
HWND
hwnd
)
DECLSPEC_HIDDEN
;
extern
void
init_win_context
(
void
)
DECLSPEC_HIDDEN
;
extern
void
*
file_list_to_drop_files
(
const
void
*
data
,
size_t
size
,
size_t
*
ret_size
)
DECLSPEC_HIDDEN
;
extern
void
*
uri_list_to_drop_files
(
const
void
*
data
,
size_t
size
,
size_t
*
ret_size
)
DECLSPEC_HIDDEN
;
static
inline
void
mirror_rect
(
const
RECT
*
window_rect
,
RECT
*
rect
)
...
...
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