Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-1.1
Commits
c6e8123d
Commit
c6e8123d
authored
Jun 22, 2003
by
Cyril Deguet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* x11/x11_dragdrop.cpp: unbelievable, Xdnd works !!
parent
6ddcf956
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
8 deletions
+19
-8
modules/gui/skins/x11/x11_dragdrop.cpp
modules/gui/skins/x11/x11_dragdrop.cpp
+19
-8
No files found.
modules/gui/skins/x11/x11_dragdrop.cpp
View file @
c6e8123d
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* x11_dragdrop.cpp: X11 implementation of the drag & drop
* x11_dragdrop.cpp: X11 implementation of the drag & drop
*****************************************************************************
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* Copyright (C) 2003 VideoLAN
* $Id: x11_dragdrop.cpp,v 1.
5 2003/06/22 00:00:28
asmax Exp $
* $Id: x11_dragdrop.cpp,v 1.
6 2003/06/22 15:07:13
asmax Exp $
*
*
* Authors: Cyril Deguet <asmax@videolan.org>
* Authors: Cyril Deguet <asmax@videolan.org>
*
*
...
@@ -108,16 +108,28 @@ void X11DropObject::DndEnter( ldata_t data )
...
@@ -108,16 +108,28 @@ void X11DropObject::DndEnter( ldata_t data )
break
;
break
;
}
}
}
}
fprintf
(
stderr
,
"dndenter
\n
"
);
}
}
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
void
X11DropObject
::
DndPosition
(
ldata_t
data
)
void
X11DropObject
::
DndPosition
(
ldata_t
data
)
{
{
Window
src
=
data
[
0
];
Window
src
=
data
[
0
];
Time
time
=
data
[
2
];
XLOCK
;
XLOCK
;
Atom
selectionAtom
=
XInternAtom
(
display
,
"XdndSelection"
,
0
);
Atom
targetAtom
=
XInternAtom
(
display
,
"text/plain"
,
0
);
Atom
propAtom
=
XInternAtom
(
display
,
"VLC_SELECTION"
,
0
);
Atom
actionAtom
=
XInternAtom
(
display
,
"XdndActionCopy"
,
0
);
Atom
actionAtom
=
XInternAtom
(
display
,
"XdndActionCopy"
,
0
);
Atom
typeAtom
=
XInternAtom
(
display
,
"XdndStatus"
,
0
);
Atom
typeAtom
=
XInternAtom
(
display
,
"XdndFinished"
,
0
);
// Convert the selection into the given target
// NEEDED or it doesn't work !!!
XConvertSelection
(
display
,
selectionAtom
,
targetAtom
,
propAtom
,
src
,
time
);
actionAtom
=
XInternAtom
(
display
,
"XdndActionCopy"
,
0
);
typeAtom
=
XInternAtom
(
display
,
"XdndStatus"
,
0
);
XEvent
event
;
XEvent
event
;
event
.
type
=
ClientMessage
;
event
.
type
=
ClientMessage
;
...
@@ -134,19 +146,19 @@ void X11DropObject::DndPosition( ldata_t data )
...
@@ -134,19 +146,19 @@ void X11DropObject::DndPosition( ldata_t data )
{
{
event
.
xclient
.
data
.
l
[
1
]
=
0
;
// do not accept
event
.
xclient
.
data
.
l
[
1
]
=
0
;
// do not accept
}
}
event
.
xclient
.
data
.
l
[
2
]
=
0
;
// empty rectangle
int
w
,
h
;
event
.
xclient
.
data
.
l
[
3
]
=
0
;
OSAPI_GetScreenSize
(
w
,
h
);
event
.
xclient
.
data
.
l
[
2
]
=
0
;
event
.
xclient
.
data
.
l
[
3
]
=
(
w
<<
16
)
|
h
;
event
.
xclient
.
data
.
l
[
4
]
=
actionAtom
;
event
.
xclient
.
data
.
l
[
4
]
=
actionAtom
;
// Tell the source whether we accept the drop
// Tell the source whether we accept the drop
XSendEvent
(
display
,
src
,
False
,
0
,
&
event
);
XSendEvent
(
display
,
src
,
False
,
0
,
&
event
);
XUNLOCK
;
XUNLOCK
;
fprintf
(
stderr
,
"dndpos
\n
"
);
}
}
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
void
X11DropObject
::
DndLeave
(
ldata_t
data
)
void
X11DropObject
::
DndLeave
(
ldata_t
data
)
{
{
fprintf
(
stderr
,
"dndleave
\n
"
);
}
}
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
void
X11DropObject
::
DndDrop
(
ldata_t
data
)
void
X11DropObject
::
DndDrop
(
ldata_t
data
)
...
@@ -199,7 +211,6 @@ void X11DropObject::DndDrop( ldata_t data )
...
@@ -199,7 +211,6 @@ void X11DropObject::DndDrop( ldata_t data )
char
*
name
=
new
char
[
selection
.
size
()
+
1
];
char
*
name
=
new
char
[
selection
.
size
()
+
1
];
strncpy
(
name
,
selection
.
c_str
(),
selection
.
size
()
+
1
);
strncpy
(
name
,
selection
.
c_str
(),
selection
.
size
()
+
1
);
fprintf
(
stderr
,
"dnddrop %s
\n
"
,
name
);
OSAPI_PostMessage
(
NULL
,
VLC_DROP
,
(
unsigned
int
)
name
,
0
);
OSAPI_PostMessage
(
NULL
,
VLC_DROP
,
(
unsigned
int
)
name
,
0
);
}
}
...
...
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