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
e510f865
Commit
e510f865
authored
Apr 24, 2022
by
Jacek Caban
Committed by
Alexandre Julliard
Apr 28, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winex11: Move XdndDrop event handler to event.c.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
1d337249
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
39 additions
and
38 deletions
+39
-38
event.c
dlls/winex11.drv/event.c
+25
-1
unixlib.h
dlls/winex11.drv/unixlib.h
+8
-0
x11drv.h
dlls/winex11.drv/x11drv.h
+0
-1
xdnd.c
dlls/winex11.drv/xdnd.c
+6
-36
No files found.
dlls/winex11.drv/event.c
View file @
e510f865
...
...
@@ -1896,6 +1896,30 @@ static void handle_xdnd_position_event( HWND hwnd, XClientMessageEvent *event )
}
static
void
handle_xdnd_drop_event
(
HWND
hwnd
,
XClientMessageEvent
*
event
)
{
struct
dnd_drop_event_params
params
;
XClientMessageEvent
e
;
DWORD
effect
;
params
.
type
=
DND_DROP_EVENT
;
params
.
hwnd
=
hwnd
;
effect
=
handle_dnd_event
(
&
params
);
/* Tell the target we are finished. */
memset
(
&
e
,
0
,
sizeof
(
e
)
);
e
.
type
=
ClientMessage
;
e
.
display
=
event
->
display
;
e
.
window
=
event
->
data
.
l
[
0
];
e
.
message_type
=
x11drv_atom
(
XdndFinished
);
e
.
format
=
32
;
e
.
data
.
l
[
0
]
=
event
->
window
;
e
.
data
.
l
[
1
]
=
!!
effect
;
e
.
data
.
l
[
2
]
=
drop_effect_to_xdnd_action
(
effect
);
XSendEvent
(
event
->
display
,
event
->
data
.
l
[
0
],
False
,
NoEventMask
,
(
XEvent
*
)
&
e
);
}
struct
client_message_handler
{
int
atom
;
/* protocol atom */
...
...
@@ -1910,7 +1934,7 @@ static const struct client_message_handler client_messages[] =
{
XATOM_DndProtocol
,
handle_dnd_protocol
},
{
XATOM_XdndEnter
,
handle_xdnd_enter_event
},
{
XATOM_XdndPosition
,
handle_xdnd_position_event
},
{
XATOM_XdndDrop
,
X11DRV_XDND_DropE
vent
},
{
XATOM_XdndDrop
,
handle_xdnd_drop_e
vent
},
{
XATOM_XdndLeave
,
X11DRV_XDND_LeaveEvent
}
};
...
...
dlls/winex11.drv/unixlib.h
View file @
e510f865
...
...
@@ -30,9 +30,17 @@ struct format_entry
enum
dnd_event_type
{
DND_DROP_EVENT
,
DND_POSITION_EVENT
,
};
/* DND_DROP_EVENT params */
struct
dnd_drop_event_params
{
UINT
type
;
HWND
hwnd
;
};
/* DND_POSITION_EVENT params */
struct
dnd_position_event_params
{
...
...
dlls/winex11.drv/x11drv.h
View file @
e510f865
...
...
@@ -294,7 +294,6 @@ extern BOOL IME_SetCompositionString(DWORD dwIndex, LPCVOID lpComp,
DWORD
dwReadLen
)
DECLSPEC_HIDDEN
;
extern
void
IME_SetResultString
(
LPWSTR
lpResult
,
DWORD
dwResultlen
)
DECLSPEC_HIDDEN
;
extern
void
X11DRV_XDND_DropEvent
(
HWND
hWnd
,
XClientMessageEvent
*
event
)
DECLSPEC_HIDDEN
;
extern
void
X11DRV_XDND_LeaveEvent
(
HWND
hWnd
,
XClientMessageEvent
*
event
)
DECLSPEC_HIDDEN
;
extern
void
handle_dnd_enter_event
(
struct
format_entry
*
formats
,
ULONG
size
)
DECLSPEC_HIDDEN
;
...
...
dlls/winex11.drv/xdnd.c
View file @
e510f865
...
...
@@ -142,20 +142,6 @@ static IDropTarget* get_droptarget_pointer(HWND hwnd)
return
droptarget
;
}
/**************************************************************************
* X11DRV_XDND_DROPEFFECTToXdndAction
*/
static
long
X11DRV_XDND_DROPEFFECTToXdndAction
(
DWORD
effect
)
{
if
(
effect
==
DROPEFFECT_COPY
)
return
x11drv_atom
(
XdndActionCopy
);
else
if
(
effect
==
DROPEFFECT_MOVE
)
return
x11drv_atom
(
XdndActionMove
);
else
if
(
effect
==
DROPEFFECT_LINK
)
return
x11drv_atom
(
XdndActionLink
);
FIXME
(
"unknown drop effect %u, assuming XdndActionCopy
\n
"
,
effect
);
return
x11drv_atom
(
XdndActionCopy
);
}
/* Recursively searches for a window on given coordinates in a drag&drop specific manner.
*
...
...
@@ -278,14 +264,8 @@ static BOOL handle_position_event( struct dnd_position_event_params *params )
return
accept
?
effect
:
0
;
}
/**************************************************************************
* X11DRV_XDND_DropEvent
*
* Handle an XdndDrop event.
*/
void
X11DRV_XDND_DropEvent
(
HWND
hWnd
,
XClientMessageEvent
*
event
)
static
DWORD
handle_drop_event
(
struct
dnd_drop_event_params
*
params
)
{
XClientMessageEvent
e
;
IDropTarget
*
dropTarget
;
DWORD
effect
=
XDNDDropEffect
;
int
accept
=
0
;
/* Assume we're not accepting */
...
...
@@ -338,7 +318,7 @@ void X11DRV_XDND_DropEvent( HWND hWnd, XClientMessageEvent *event )
/* Only send WM_DROPFILES if Drop didn't succeed or DROPEFFECT_NONE was set.
* Doing both causes winamp to duplicate the dropped files (#29081) */
HWND
hwnd_drop
=
window_accepting_files
(
window_from_point_dnd
(
hWnd
,
XDNDxy
));
HWND
hwnd_drop
=
window_accepting_files
(
window_from_point_dnd
(
params
->
hwnd
,
XDNDxy
));
if
(
hwnd_drop
&&
X11DRV_XDND_HasHDROP
())
{
...
...
@@ -354,20 +334,7 @@ void X11DRV_XDND_DropEvent( HWND hWnd, XClientMessageEvent *event )
TRACE
(
"effectRequested(0x%x) accept(%d) performed(0x%x) at x(%d),y(%d)
\n
"
,
XDNDDropEffect
,
accept
,
effect
,
XDNDxy
.
x
,
XDNDxy
.
y
);
/* Tell the target we are finished. */
memset
(
&
e
,
0
,
sizeof
(
e
));
e
.
type
=
ClientMessage
;
e
.
display
=
event
->
display
;
e
.
window
=
event
->
data
.
l
[
0
];
e
.
message_type
=
x11drv_atom
(
XdndFinished
);
e
.
format
=
32
;
e
.
data
.
l
[
0
]
=
event
->
window
;
e
.
data
.
l
[
1
]
=
accept
;
if
(
accept
)
e
.
data
.
l
[
2
]
=
X11DRV_XDND_DROPEFFECTToXdndAction
(
effect
);
else
e
.
data
.
l
[
2
]
=
None
;
XSendEvent
(
event
->
display
,
event
->
data
.
l
[
0
],
False
,
NoEventMask
,
(
XEvent
*
)
&
e
);
return
accept
?
effect
:
0
;
}
/**************************************************************************
...
...
@@ -766,6 +733,9 @@ UINT handle_dnd_event( void *params )
switch
(
*
(
UINT
*
)
params
)
{
case
DND_DROP_EVENT
:
return
handle_drop_event
(
params
);
case
DND_POSITION_EVENT
:
return
handle_position_event
(
params
);
...
...
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