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
2b59a199
Commit
2b59a199
authored
Nov 21, 2019
by
Ulrich Sibiller
Committed by
Mike Gabriel
Jan 05, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clipboard.c: simplify nxagentSetSelectionOwner
We do not need to loop over all selections. We have a helper for that.
parent
15ef7087
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
33 deletions
+26
-33
Clipboard.c
nx-X11/programs/Xserver/hw/nxagent/Clipboard.c
+26
-33
No files found.
nx-X11/programs/Xserver/hw/nxagent/Clipboard.c
View file @
2b59a199
...
...
@@ -1622,42 +1622,35 @@ void nxagentSetSelectionOwner(Selection *pSelection)
}
#endif
/*
* Only for PRIMARY and CLIPBOARD selections.
*/
for
(
int
i
=
0
;
i
<
nxagentMaxSelections
;
i
++
)
int
i
=
nxagentFindCurrentSelectionIndex
(
pSelection
->
selection
);
if
(
i
<
NumCurrentSelections
)
{
/* FIXME: using CurrentSelections with the index limited my MaxSelections looks wrong */
if
(
pSelection
->
selection
==
CurrentSelections
[
i
].
selection
)
{
#ifdef DEBUG
fprintf
(
stderr
,
"%s: lastSelectionOwner.client [%p] index [%d] -> [%p] index [%d]
\n
"
,
__func__
,
(
void
*
)
lastSelectionOwner
[
i
].
client
,
CLINDEX
(
lastSelectionOwner
[
i
].
client
),
(
void
*
)
pSelection
->
client
,
CLINDEX
(
pSelection
->
client
));
fprintf
(
stderr
,
"%s: lastSelectionOwner.window [0x%x] -> [0x%x]
\n
"
,
__func__
,
lastSelectionOwner
[
i
].
window
,
pSelection
->
window
);
fprintf
(
stderr
,
"%s: lastSelectionOwner.windowPtr [%p] -> [%p] [0x%x] (serverWindow: [0x%x])
\n
"
,
__func__
,
(
void
*
)
lastSelectionOwner
[
i
].
windowPtr
,
(
void
*
)
pSelection
->
pWin
,
nxagentWindow
(
pSelection
->
pWin
),
serverWindow
);
fprintf
(
stderr
,
"%s: lastSelectionOwner.lastTimeChanged [%d]
\n
"
,
__func__
,
lastSelectionOwner
[
i
].
lastTimeChanged
);
#endif
#ifdef DEBUG
fprintf
(
stderr
,
"%s: lastSelectionOwner.client [%p] index [%d] -> [%p] index [%d]
\n
"
,
__func__
,
(
void
*
)
lastSelectionOwner
[
i
].
client
,
CLINDEX
(
lastSelectionOwner
[
i
].
client
),
(
void
*
)
pSelection
->
client
,
CLINDEX
(
pSelection
->
client
));
fprintf
(
stderr
,
"%s: lastSelectionOwner.window [0x%x] -> [0x%x]
\n
"
,
__func__
,
lastSelectionOwner
[
i
].
window
,
pSelection
->
window
);
fprintf
(
stderr
,
"%s: lastSelectionOwner.windowPtr [%p] -> [%p] [0x%x] (serverWindow: [0x%x])
\n
"
,
__func__
,
(
void
*
)
lastSelectionOwner
[
i
].
windowPtr
,
(
void
*
)
pSelection
->
pWin
,
nxagentWindow
(
pSelection
->
pWin
),
serverWindow
);
fprintf
(
stderr
,
"%s: lastSelectionOwner.lastTimeChanged [%d]
\n
"
,
__func__
,
lastSelectionOwner
[
i
].
lastTimeChanged
);
#endif
/*
* inform the real X server that our serverWindow is the
* clipboard owner.
*/
XSetSelectionOwner
(
nxagentDisplay
,
lastSelectionOwner
[
i
].
selection
,
serverWindow
,
CurrentTime
);
/*
* inform the real X server that our serverWindow is the
* clipboard owner.
*/
XSetSelectionOwner
(
nxagentDisplay
,
lastSelectionOwner
[
i
].
selection
,
serverWindow
,
CurrentTime
);
/*
* The real owner window (inside nxagent) is stored in
* lastSelectionOwner.window. lastSelectionOwner.windowPtr
* points to the struct that contains all information about the
* owner window.
*/
nxagentStoreSelectionOwner
(
i
,
pSelection
);
}
/*
* The real owner window (inside nxagent) is stored in
* lastSelectionOwner.window. lastSelectionOwner.windowPtr
* points to the struct that contains all information about the
* owner window.
*/
nxagentStoreSelectionOwner
(
i
,
pSelection
);
}
lastClientWindowPtr
=
NULL
;
...
...
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