Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nx-libs
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
dimbor
nx-libs
Commits
1d0d5473
You need to sign in or sign up before continuing.
Commit
1d0d5473
authored
Nov 17, 2019
by
Ulrich Sibiller
Committed by
Mike Gabriel
Jan 05, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clipboard.c: add more explaining comments
parent
166102e0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
7 deletions
+24
-7
Clipboard.c
nx-X11/programs/Xserver/hw/nxagent/Clipboard.c
+24
-7
No files found.
nx-X11/programs/Xserver/hw/nxagent/Clipboard.c
View file @
1d0d5473
...
...
@@ -185,6 +185,9 @@ const char * GetClientSelectionStageString(int stage)
/*
* see also nx-X11/lib/src/ErrDes.c
*
* We use our own version to avoid Xlib doing expensive calls.
* FIXME: Must check if XGetErrorText() is really causing traffic over the wire.
*/
const
char
*
GetXErrorString
(
int
code
)
{
...
...
@@ -668,9 +671,8 @@ void nxagentClearSelection(XEvent *X)
/*
* Send a SelectionNotify event as reply to the RequestSelection
* event X. If success is True take the property from the event, else
* take None (which reports "failed/denied" to the requestor.
* take None (which reports "failed/denied" to the requestor
)
.
*/
void
nxagentReplyRequestSelection
(
XEvent
*
X
,
Bool
success
)
{
XSelectionEvent
eventSelection
=
{
...
...
@@ -752,8 +754,7 @@ void nxagentRequestSelection(XEvent *X)
{
/*
* the selection request target is TARGETS. The requestor is
* asking for a list of supported data formats. Currently
* there's only one format we support: XA_STRING
* asking for a list of supported data formats.
*
* The selection does not matter here, we will return this for
* PRIMARY and CLIPBOARD.
...
...
@@ -1703,6 +1704,12 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection,
}
}
/*
* if lastClientWindowPtr is set we are waiting for an answer from
* the real X server. If that answer takes more than 5 seconds we
* consider the conversion failed and tell our client about that.
* The new request that lead us here is then processed.
*/
if
(
lastClientWindowPtr
!=
NULL
)
{
#ifdef TEST
...
...
@@ -1724,6 +1731,11 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection,
}
else
{
/*
* we got another convert request while already waiting for an
* answer from the real X server to a previous convert request,
* which we cannot handle (yet). So return an error.
*/
#ifdef DEBUG
fprintf
(
stderr
,
"%s: got request "
"before timeout expired on last request, notifying failure to client
\n
"
,
__func__
);
...
...
@@ -1758,7 +1770,7 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection,
* for a list of supported data formats. Currently there's 4 of them.
*
* FIXME: I am wondering if we should align this with
* nxagentRequestSelection, where we
only report one forma
t.
* nxagentRequestSelection, where we
use another target lis
t.
*/
if
(
target
==
clientTARGETS
)
{
...
...
@@ -1976,9 +1988,9 @@ int nxagentSendNotify(xEvent *event)
* .property must be a server-side Atom. As this property is only
* set on our serverWindow and normally there are no other
* properties except serverCutProperty, the only thing we need to
* ensure is that the internal Atom clientCutProperty
must differ
* ensure is that the internal Atom clientCutProperty
differs
* from the server-side serverCutProperty Atom. The actual name is
* not important. To be clean here we use a sep
e
rate
* not important. To be clean here we use a sep
a
rate
* serverClientCutProperty.
*/
...
...
@@ -2192,6 +2204,11 @@ Bool nxagentInitClipboard(WindowPtr pWin)
for
(
int
i
=
0
;
i
<
nxagentMaxSelections
;
i
++
)
{
/*
* if we have a selection inform the (new) real Xserver and
* claim the ownership. Note that we report our serverWindow as
* owner, not the real window!
*/
if
(
lastSelectionOwner
[
i
].
client
&&
lastSelectionOwner
[
i
].
window
)
{
XSetSelectionOwner
(
nxagentDisplay
,
lastSelectionOwner
[
i
].
selection
,
iWindow
,
CurrentTime
);
...
...
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