aboutsummaryrefslogtreecommitdiff
path: root/nx-X11
diff options
context:
space:
mode:
authorUlrich Sibiller <uli42@gmx.de>2020-09-23 17:03:00 +0200
committerUlrich Sibiller <uli42@gmx.de>2021-06-20 20:12:50 +0200
commitd79db429dd1db5a507dcecb2bd8f79d4e3545be4 (patch)
tree2b2ac9a93eed434df184022e7e1801a3b3b8a66d /nx-X11
parent3682be5941c549c9fc215575d01261fae6c1fa63 (diff)
downloadnx-libs-d79db429dd1db5a507dcecb2bd8f79d4e3545be4.tar.gz
nx-libs-d79db429dd1db5a507dcecb2bd8f79d4e3545be4.tar.bz2
nx-libs-d79db429dd1db5a507dcecb2bd8f79d4e3545be4.zip
Clipboard.c: always print SelectionCallBackKind in debug output
Diffstat (limited to 'nx-X11')
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Clipboard.c38
1 files changed, 26 insertions, 12 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c
index 605716e9d..40a812b9b 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c
@@ -815,6 +815,10 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X)
char *strSelection = XGetAtomName(nxagentDisplay, X->xselectionrequest.selection);
char *strProperty = XGetAtomName(nxagentDisplay, X->xselectionrequest.property);
+ if (X->xselectionrequest.requestor == serverWindow)
+ {
+ fprintf(stderr, "%s: this event has been sent by nxagent!\n", __func__);;
+ }
fprintf(stderr, "%s: Received SelectionRequestEvent from real server: selection [%ld][%s] " \
"target [%ld][%s] requestor [display[%s]/0x%lx] destination [%ld][%s]\n",
__func__,
@@ -1732,6 +1736,28 @@ void nxagentSetSelectionCallback(CallbackListPtr *callbacks, void *data,
* way to identify that situation during callback processing we
* could get rid of the Trap...
*/
+
+ SelectionInfoRec *info = (SelectionInfoRec *)args;
+
+ #ifdef DEBUG
+ if (info->kind == SelectionSetOwner)
+ {
+ fprintf(stderr, "%s: SelectionCallbackKind [SelectionSetOwner]\n", __func__);
+ }
+ else if (info->kind == SelectionWindowDestroy)
+ {
+ fprintf(stderr, "%s: SelectionCallbackKind [SelectionWindowDestroy]\n", __func__);
+ }
+ else if (info->kind == SelectionClientClose)
+ {
+ fprintf(stderr, "%s: SelectionCallbackKind [SelectionClientClose]\n", __func__);
+ }
+ else
+ {
+ fprintf(stderr, "%s: SelectionCallbackKind [unknown]\n", __func__);
+ }
+ #endif
+
if (nxagentExternalClipboardEventTrap)
{
#ifdef DEBUG
@@ -1740,8 +1766,6 @@ void nxagentSetSelectionCallback(CallbackListPtr *callbacks, void *data,
return;
}
- SelectionInfoRec *info = (SelectionInfoRec *)args;
-
Selection * pCurSel = (Selection *)info->selection;
#ifdef DEBUG
@@ -1751,7 +1775,6 @@ void nxagentSetSelectionCallback(CallbackListPtr *callbacks, void *data,
if (info->kind == SelectionSetOwner)
{
#ifdef DEBUG
- fprintf(stderr, "%s: called with SelectionCallbackKind SelectionSetOwner\n", __func__);
fprintf(stderr, "%s: pCurSel->pWin [0x%x]\n", __func__, WINDOWID(pCurSel->pWin));
fprintf(stderr, "%s: pCurSel->selection [%s]\n", __func__, NameForAtom(pCurSel->selection));
#endif
@@ -1769,21 +1792,12 @@ void nxagentSetSelectionCallback(CallbackListPtr *callbacks, void *data,
}
else if (info->kind == SelectionWindowDestroy)
{
- #ifdef DEBUG
- fprintf(stderr, "%s: called with SelectionCallbackKind SelectionWindowDestroy\n", __func__);
- #endif
}
else if (info->kind == SelectionClientClose)
{
- #ifdef DEBUG
- fprintf(stderr, "%s: called with SelectionCallbackKind SelectionClientClose\n", __func__);
- #endif
}
else
{
- #ifdef DEBUG
- fprintf(stderr, "%s: called with unknown SelectionCallbackKind\n", __func__);
- #endif
}
}
#endif