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
6c0536a2
Commit
6c0536a2
authored
Nov 22, 2019
by
Ulrich Sibiller
Committed by
Mike Gabriel
Jan 05, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clipboard.c: introduce helper macro IS_INTERNAL_OWNER
Using this macro makes the code more readable
parent
2b59a199
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
9 deletions
+11
-9
Clipboard.c
nx-X11/programs/Xserver/hw/nxagent/Clipboard.c
+11
-9
No files found.
nx-X11/programs/Xserver/hw/nxagent/Clipboard.c
View file @
6c0536a2
...
...
@@ -98,6 +98,8 @@ typedef struct _SelectionOwner
static
SelectionOwner
*
lastSelectionOwner
;
static
XlibAtom
nxagentLastRequestedSelection
;
#define IS_INTERNAL_OWNER(lsoindex) (lastSelectionOwner[lsoindex].client != NULL)
/*
* Needed to handle the notify selection event to
* be sent to client once the selection property
...
...
@@ -661,7 +663,7 @@ void nxagentClearSelection(XEvent *X)
if
(
i
<
nxagentMaxSelections
)
{
if
(
lastSelectionOwner
[
i
].
client
!=
NULL
)
if
(
IS_INTERNAL_OWNER
(
i
)
)
{
/* send a SelectionClear event to (our) previous owner */
xEvent
x
=
{
0
};
...
...
@@ -888,7 +890,7 @@ void nxagentRequestSelection(XEvent *X)
int
i
=
nxagentFindLastSelectionOwnerIndex
(
X
->
xselectionrequest
.
selection
);
if
(
i
<
nxagentMaxSelections
)
{
if
(
(
lastClientWindowPtr
!=
NULL
)
&&
(
lastSelectionOwner
[
i
].
client
!=
NULL
))
if
(
lastClientWindowPtr
!=
NULL
&&
IS_INTERNAL_OWNER
(
i
))
{
/*
* Request the real X server to transfer the selection content
...
...
@@ -910,7 +912,7 @@ void nxagentRequestSelection(XEvent *X)
* the selection to the clientCutProperty on nxagent's root
* window
*/
if
(
lastSelectionOwner
[
i
].
client
!=
NULL
&&
if
(
IS_INTERNAL_OWNER
(
i
)
&&
nxagentOption
(
Clipboard
)
!=
ClipboardClient
)
{
/*
...
...
@@ -1361,9 +1363,9 @@ void nxagentHandleSelectionNotifyFromXServer(XEvent *X)
if
(
i
<
nxagentMaxSelections
)
{
/* if the last owner was an internal one */
if
(
(
lastSelectionOwner
[
i
].
client
!=
NULL
)
&&
(
lastSelectionOwner
[
i
].
windowPtr
!=
NULL
)
&&
(
X
->
xselection
.
property
==
serverClientCutProperty
)
)
if
(
IS_INTERNAL_OWNER
(
i
)
&&
lastSelectionOwner
[
i
].
windowPtr
!=
NULL
&&
X
->
xselection
.
property
==
serverClientCutProperty
)
{
Atom
atomReturnType
;
int
resultFormat
;
...
...
@@ -1725,8 +1727,8 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection,
for
(
int
i
=
0
;
i
<
nxagentMaxSelections
;
i
++
)
{
if
(
(
selection
==
CurrentSelections
[
i
].
selection
)
&&
(
lastSelectionOwner
[
i
].
client
!=
NULL
))
if
(
selection
==
CurrentSelections
[
i
].
selection
&&
IS_INTERNAL_OWNER
(
i
))
{
/*
* There is a client owner on the agent side, let normal dix stuff happen.
...
...
@@ -2248,7 +2250,7 @@ Bool nxagentInitClipboard(WindowPtr pWin)
* claim the ownership. Note that we report our serverWindow as
* owner, not the real window!
*/
if
(
lastSelectionOwner
[
i
].
client
&&
lastSelectionOwner
[
i
].
window
)
if
(
IS_INTERNAL_OWNER
(
i
)
&&
lastSelectionOwner
[
i
].
window
)
{
XSetSelectionOwner
(
nxagentDisplay
,
lastSelectionOwner
[
i
].
selection
,
serverWindow
,
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