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
1af01db3
Commit
1af01db3
authored
Aug 05, 2019
by
Ulrich Sibiller
Committed by
Mike Gabriel
Sep 29, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clipboard.c: factor out nxagentReplyRequestSelection
parent
5e248710
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
27 deletions
+38
-27
Clipboard.c
nx-X11/programs/Xserver/hw/nxagent/Clipboard.c
+38
-27
No files found.
nx-X11/programs/Xserver/hw/nxagent/Clipboard.c
View file @
1af01db3
...
...
@@ -595,10 +595,37 @@ void nxagentClearSelection(XEvent *X)
nxagentPrintClipboardStat
(
"after nxagentClearSelection"
);
}
void
nxagentRequestSelection
(
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.
*/
void
nxagentReplyRequestSelection
(
XEvent
*
X
,
Bool
success
)
{
XSelectionEvent
eventSelection
=
{
0
};
XSelectionEvent
eventSelection
=
{
.
requestor
=
X
->
xselectionrequest
.
requestor
,
.
selection
=
X
->
xselectionrequest
.
selection
,
.
target
=
X
->
xselectionrequest
.
target
,
.
time
=
X
->
xselectionrequest
.
time
,
.
property
=
X
->
xselectionrequest
.
property
};
if
(
!
success
)
{
#ifdef DEBUG
fprintf
(
stderr
,
"%s: denying request
\n
"
,
__func__
);
#endif
eventSelection
.
property
=
None
;
}
SendSelectionNotifyEventToServer
(
&
eventSelection
);
NXFlushDisplay
(
nxagentDisplay
,
NXFlushLink
);
}
void
nxagentRequestSelection
(
XEvent
*
X
)
{
#ifdef DEBUG
fprintf
(
stderr
,
"%s: Got called.
\n
"
,
__func__
);
#endif
...
...
@@ -631,9 +658,6 @@ FIXME: Do we need this?
SAFE_XFree(strTarget);
*/
memset
(
&
eventSelection
,
0
,
sizeof
(
XSelectionEvent
));
eventSelection
.
property
=
None
;
if
(
X
->
xselectionrequest
.
target
==
serverTARGETS
)
{
Atom
targets
[]
=
{
XA_STRING
};
...
...
@@ -647,7 +671,7 @@ FIXME: Do we need this?
PropModeReplace
,
(
unsigned
char
*
)
&
targets
,
numTargets
);
eventSelection
.
property
=
X
->
xselectionrequest
.
property
;
nxagentReplyRequestSelection
(
X
,
True
)
;
}
else
if
(
X
->
xselectionrequest
.
target
==
serverTIMESTAMP
)
{
...
...
@@ -662,17 +686,14 @@ FIXME: Do we need this?
PropModeReplace
,
(
unsigned
char
*
)
&
lastSelectionOwner
[
i
].
lastTimeChanged
,
1
);
eventSelection
.
property
=
X
->
xselectionrequest
.
property
;
nxagentReplyRequestSelection
(
X
,
True
)
;
}
}
eventSelection
.
requestor
=
X
->
xselectionrequest
.
requestor
;
eventSelection
.
selection
=
X
->
xselectionrequest
.
selection
;
eventSelection
.
target
=
X
->
xselectionrequest
.
target
;
eventSelection
.
time
=
X
->
xselectionrequest
.
time
;
SendSelectionNotifyEventToServer
(
&
eventSelection
);
else
{
/* deny the request */
nxagentReplyRequestSelection
(
X
,
False
);
}
return
;
}
...
...
@@ -750,18 +771,8 @@ FIXME: Do we need this?
}
else
{
/*
* Probably we must send a Notify
* to requestor with property None.
*/
eventSelection
.
requestor
=
X
->
xselectionrequest
.
requestor
;
eventSelection
.
selection
=
X
->
xselectionrequest
.
selection
;
eventSelection
.
target
=
X
->
xselectionrequest
.
target
;
eventSelection
.
property
=
None
;
eventSelection
.
time
=
X
->
xselectionrequest
.
time
;
SendSelectionNotifyEventToServer
(
&
eventSelection
);
/* deny the request */
nxagentReplyRequestSelection
(
X
,
False
);
}
}
}
...
...
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