[X2Go-Commits] [nx-libs] 330/429: Clipboard.c: always print SelectionCallBackKind in debug output

git-admin at x2go.org git-admin at x2go.org
Mon Oct 18 09:36:58 CEST 2021


This is an automated email from the git hooks/post-receive script.

x2go pushed a commit to branch 3.6.x
in repository nx-libs.

commit d79db429dd1db5a507dcecb2bd8f79d4e3545be4
Author: Ulrich Sibiller <uli42 at gmx.de>
Date:   Wed Sep 23 17:03:00 2020 +0200

    Clipboard.c: always print SelectionCallBackKind in debug output
---
 nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 38 ++++++++++++++++++--------
 1 file 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

--
Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/nx-libs.git


More information about the x2go-commits mailing list