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
5d26addd
Commit
5d26addd
authored
Oct 16, 2018
by
Ulrich Sibiller
Committed by
Mike Gabriel
Oct 27, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clipboard.c: new debug function to reduce duplicate code
parent
1c4c9f60
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
53 additions
and
13 deletions
+53
-13
Clipboard.c
nx-X11/programs/Xserver/hw/nxagent/Clipboard.c
+53
-13
No files found.
nx-X11/programs/Xserver/hw/nxagent/Clipboard.c
View file @
5d26addd
...
...
@@ -212,6 +212,57 @@ int nxagentSendNotify(xEvent *event);
void
nxagentPrintClipboardStat
(
char
*
);
#ifdef DEBUG
void
nxagentPrintSelectionStat
(
int
sel
)
{
SelectionOwner
lOwner
=
lastSelectionOwner
[
sel
];
Selection
curSel
=
CurrentSelections
[
sel
];
char
*
s
=
NULL
;
#ifdef CLIENTIDS
fprintf
(
stderr
,
" lastSelectionOwner[].client [%p] index [%d] PID [%d] Cmd [%s]
\n
"
,
lOwner
.
client
,
lOwner
.
client
?
lOwner
.
client
->
index
:
-
1
,
GetClientPid
(
lOwner
.
client
),
GetClientCmdName
(
lOwner
.
client
));
#else
fprintf
(
stderr
,
" lastSelectionOwner[].client [%p] index [%d]
\n
"
,
lOwner
.
client
,
lOwner
.
client
?
lOwner
.
client
->
index
:
-
1
);
#endif
fprintf
(
stderr
,
" lastSelectionOwner[].window [0x%x]
\n
"
,
lOwner
.
window
);
fprintf
(
stderr
,
" lastSelectionOwner[].windowPtr [%p]
\n
"
,
lOwner
.
windowPtr
);
fprintf
(
stderr
,
" lastSelectionOwner[].lastTimeChanged [%u]
\n
"
,
lOwner
.
lastTimeChanged
);
/*
print the selection name.
*/
if
(
lOwner
.
client
)
{
fprintf
(
stderr
,
" lastSelectionOwner[].selection [% 4d][%s] (local)
\n
"
,
lOwner
.
selection
,
NameForAtom
(
lOwner
.
selection
));
}
else
{
SAFE_XFree
(
s
);
s
=
XGetAtomName
(
nxagentDisplay
,
lOwner
.
selection
);
fprintf
(
stderr
,
" lastSelectionOwner[].selection [% 4d][%s] (remote)
\n
"
,
lOwner
.
selection
,
validateString
(
s
));
SAFE_XFree
(
s
);
}
#ifdef CLIENTIDS
fprintf
(
stderr
,
" CurrentSelections[].client [%p] index [%d] PID [%d] Cmd [%s]
\n
"
,
curSel
.
client
,
curSel
.
client
?
curSel
.
client
->
index
:
-
1
,
GetClientPid
(
curSel
.
client
),
GetClientCmdName
(
curSel
.
client
));
#else
fprintf
(
stderr
,
" CurrentSelections[].client [%p] index [%d]
\n
"
,
curSel
.
client
,
curSel
.
client
?
curSel
.
client
->
index
:
-
1
);
#endif
fprintf
(
stderr
,
" CurrentSelections[].window [0x%x]
\n
"
,
curSel
.
window
);
return
;
}
#endif
void
nxagentPrintClipboardStat
(
char
*
header
)
{
#ifdef DEBUG
...
...
@@ -259,20 +310,9 @@ void nxagentPrintClipboardStat(char *header)
fprintf
(
stderr
,
" lastClientStage (ClientSelectionStage) [%d][%s]
\n
"
,
lastClientStage
,
GetClientSelectionStageString
(
lastClientStage
));
fprintf
(
stderr
,
"PRIMARY
\n
"
);
fprintf
(
stderr
,
" lastSelectionOwner[].client [%p]
\n
"
,
(
void
*
)
lastSelectionOwner
[
nxagentPrimarySelection
].
client
);
fprintf
(
stderr
,
" lastSelectionOwner[].window [0x%x]
\n
"
,
lastSelectionOwner
[
nxagentPrimarySelection
].
window
);
fprintf
(
stderr
,
" lastSelectionOwner[].windowPtr [%p]
\n
"
,
(
void
*
)
lastSelectionOwner
[
nxagentPrimarySelection
].
windowPtr
);
fprintf
(
stderr
,
" lastSelectionOwner[].lastTimeChanged [%u]
\n
"
,
lastSelectionOwner
[
nxagentPrimarySelection
].
lastTimeChanged
);
fprintf
(
stderr
,
" CurrentSelections[].client [%p]
\n
"
,
(
void
*
)
CurrentSelections
[
nxagentPrimarySelection
].
client
);
fprintf
(
stderr
,
" CurrentSelections[].window [0x%x]
\n
"
,
CurrentSelections
[
nxagentPrimarySelection
].
window
);
nxagentPrintSelectionStat
(
nxagentPrimarySelection
);
fprintf
(
stderr
,
"CLIPBOARD
\n
"
);
fprintf
(
stderr
,
" lastSelectionOwner[].client [%p]
\n
"
,
(
void
*
)
lastSelectionOwner
[
nxagentClipboardSelection
].
client
);
fprintf
(
stderr
,
" lastSelectionOwner[].window [0x%x]
\n
"
,
lastSelectionOwner
[
nxagentClipboardSelection
].
window
);
fprintf
(
stderr
,
" lastSelectionOwner[].windowPtr [%p]
\n
"
,
(
void
*
)
lastSelectionOwner
[
nxagentClipboardSelection
].
windowPtr
);
fprintf
(
stderr
,
" lastSelectionOwner[].lastTimeChanged [%u]
\n
"
,
lastSelectionOwner
[
nxagentClipboardSelection
].
lastTimeChanged
);
fprintf
(
stderr
,
" CurrentSelections[].client [%p]
\n
"
,
(
void
*
)
CurrentSelections
[
nxagentClipboardSelection
].
client
);
fprintf
(
stderr
,
" CurrentSelections[].window [0x%x]
\n
"
,
CurrentSelections
[
nxagentClipboardSelection
].
window
);
nxagentPrintSelectionStat
(
nxagentClipboardSelection
);
fprintf
(
stderr
,
"Atoms (server side)
\n
"
);
SAFE_XFree
(
s
);
s
=
XGetAtomName
(
nxagentDisplay
,
serverTARGETS
);
...
...
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