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
1feb4985
Commit
1feb4985
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: make agentClipboardStatus a Boolean
and add debugging information around its checks.
parent
fba36716
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
14 deletions
+43
-14
Clipboard.c
nx-X11/programs/Xserver/hw/nxagent/Clipboard.c
+43
-14
No files found.
nx-X11/programs/Xserver/hw/nxagent/Clipboard.c
View file @
1feb4985
...
...
@@ -67,7 +67,7 @@ extern Selection *CurrentSelections;
int
nxagentLastClipboardClient
=
-
1
;
static
int
agentClipboard
Status
;
static
int
agentClipboard
Initialized
=
False
;
#ifdef DEBUG
static
int
clientAccum
;
#endif
...
...
@@ -285,14 +285,14 @@ void nxagentPrintClipboardStat(char *header)
fprintf
(
stderr
,
"/----- Clipboard internal status - %s -----
\n
"
,
header
);
fprintf
(
stderr
,
" current time (Time) [%u]
\n
"
,
GetTimeInMillis
());
fprintf
(
stderr
,
" agentClipboard
Status (int) [%d]
\n
"
,
agentClipboardStatus
);
fprintf
(
stderr
,
" agentClipboard
Initialized (Bool) [%s]
\n
"
,
agentClipboardInitialized
?
"True"
:
"False"
);
fprintf
(
stderr
,
" clientAccum (int) [%d]
\n
"
,
clientAccum
);
fprintf
(
stderr
,
" nxagentMaxSelections (int) [%d]
\n
"
,
nxagentMaxSelections
);
fprintf
(
stderr
,
" NumCurrentSelections (int) [%d]
\n
"
,
NumCurrentSelections
);
fprintf
(
stderr
,
" serverWindow (Window) [0x%x]
\n
"
,
serverWindow
);
fprintf
(
stderr
,
" nxagentLastClipboardClient (int) [%d]
\n
"
,
nxagentLastClipboardClient
);
fprintf
(
stderr
,
" Clipboard
Mode
"
);
fprintf
(
stderr
,
" Clipboard
mode
"
);
switch
(
nxagentOption
(
Clipboard
))
{
case
ClipboardBoth
:
fprintf
(
stderr
,
"[Both]"
);
break
;;
...
...
@@ -597,9 +597,19 @@ void nxagentClearSelection(XEvent *X)
nxagentPrintClipboardStat
(
"before nxagentClearSelection"
);
if
(
agentClipboardStatus
!=
1
||
nxagentOption
(
Clipboard
)
==
ClipboardServer
)
if
(
!
agentClipboardInitialized
)
{
#ifdef DEBUG
fprintf
(
stderr
,
"%s: clipboard not initialized - doing nothing.
\n
"
,
__func__
);
#endif
return
;
}
if
(
nxagentOption
(
Clipboard
)
==
ClipboardServer
)
{
#ifdef DEBUG
fprintf
(
stderr
,
"%s: clipboard mode 'server' - doing nothing.
\n
"
,
__func__
);
#endif
return
;
}
...
...
@@ -696,8 +706,11 @@ void nxagentRequestSelection(XEvent *X)
nxagentPrintClipboardStat
(
"before nxagentRequestSelection"
);
if
(
agentClipboardStatus
!=
1
)
if
(
!
agentClipboardInitialized
)
{
#ifdef DEBUG
fprintf
(
stderr
,
"%s: clipboard not initialized - doing nothing.
\n
"
,
__func__
);
#endif
return
;
}
...
...
@@ -1215,8 +1228,11 @@ void nxagentCollectPropertyEvent(int resource)
*/
void
nxagentHandleSelectionNotifyFromXServer
(
XEvent
*
X
)
{
if
(
agentClipboardStatus
!=
1
)
if
(
!
agentClipboardInitialized
)
{
#ifdef DEBUG
fprintf
(
stderr
,
"%s: clipboard not initialized - doing nothing.
\n
"
,
__func__
);
#endif
return
;
}
...
...
@@ -1521,8 +1537,11 @@ void nxagentSetSelectionCallback(CallbackListPtr *callbacks, void *data,
*/
void
nxagentSetSelectionOwner
(
Selection
*
pSelection
)
{
if
(
agentClipboardStatus
!=
1
)
if
(
!
agentClipboardInitialized
)
{
#ifdef DEBUG
fprintf
(
stderr
,
"%s: clipboard not initialized - doing nothing.
\n
"
,
__func__
);
#endif
return
;
}
...
...
@@ -1637,9 +1656,19 @@ void nxagentNotifyConvertFailure(ClientPtr client, Window requestor,
int
nxagentConvertSelection
(
ClientPtr
client
,
WindowPtr
pWin
,
Atom
selection
,
Window
requestor
,
Atom
property
,
Atom
target
,
Time
time
)
{
if
(
agentClipboardStatus
!=
1
||
nxagentOption
(
Clipboard
)
==
ClipboardServer
)
if
(
!
agentClipboardInitialized
)
{
#ifdef DEBUG
fprintf
(
stderr
,
"%s: clipboard not initialized - doing nothing.
\n
"
,
__func__
);
#endif
return
0
;
}
if
(
nxagentOption
(
Clipboard
)
==
ClipboardServer
)
{
#ifdef DEBUG
fprintf
(
stderr
,
"%s: clipboard mode 'server' - doing nothing.
\n
"
,
__func__
);
#endif
return
0
;
}
...
...
@@ -1894,10 +1923,10 @@ int nxagentSendNotify(xEvent *event)
fprintf
(
stderr
,
"%s: Got called.
\n
"
,
__func__
);
#endif
if
(
agentClipboardStatus
!=
1
)
if
(
!
agentClipboardInitialized
)
{
#ifdef DEBUG
fprintf
(
stderr
,
"%s:
agentClipboardStatus != 1
- doing nothing.
\n
"
,
__func__
);
fprintf
(
stderr
,
"%s:
clipboard not initialized
- doing nothing.
\n
"
,
__func__
);
#endif
return
0
;
}
...
...
@@ -2049,7 +2078,7 @@ int nxagentInitClipboard(WindowPtr pWin)
}
#endif
agentClipboard
Status
=
0
;
agentClipboard
Initialized
=
False
;
serverWindow
=
iWindow
;
/*
...
...
@@ -2170,7 +2199,7 @@ int nxagentInitClipboard(WindowPtr pWin)
}
}
agentClipboard
Status
=
1
;
agentClipboard
Initialized
=
True
;
#ifdef DEBUG
fprintf
(
stderr
,
"%s: Clipboard initialization completed.
\n
"
,
__func__
);
...
...
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