[X2Go-Commits] [nx-libs] 291/429: Use NXAGENT_ONSTART define at more locations
git-admin at x2go.org
git-admin at x2go.org
Mon Oct 18 09:36:51 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 8fe2c114084743e8726ae39089e3aa1491d22719
Author: Ulrich Sibiller <uli42 at gmx.de>
Date: Tue Feb 9 19:09:21 2021 +0100
Use NXAGENT_ONSTART define at more locations
marking all the code that is not really required when not using
nomachine's nxclient.
---
nx-X11/programs/Xserver/hw/nxagent/Atoms.c | 7 +++++--
nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 3 +++
nx-X11/programs/Xserver/hw/nxagent/Reconnect.c | 2 ++
nx-X11/programs/Xserver/hw/nxagent/Screen.c | 1 +
nx-X11/programs/Xserver/hw/nxagent/Splash.c | 2 ++
nx-X11/programs/Xserver/hw/nxagent/Window.c | 2 ++
6 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Atoms.c b/nx-X11/programs/Xserver/hw/nxagent/Atoms.c
index ea7ad7599..2ddf87e55 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Atoms.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Atoms.c
@@ -89,9 +89,12 @@ static char *nxagentAtomNames[NXAGENT_NUMBER_OF_ATOMS + 1] =
"WM_NX_READY", /* 3 */
/* nxagent takes the ownership of the selection with this name
to signal the nxclient (or any other watching program)
- it is ready. */
+ it is ready. This is only used if NXAGENT_ONSTART is defined.
+ We cannot enclose it in #ifdef here because we use the numeric
+ indices to this structure at multiple places. */
"MCOPGLOBALS", /* 4 */
- /* used for artsd support. */
+ /* used for artsd support. Only used if compiled with
+ NXAGENT_ARTSD */
"NX_CUT_BUFFER_SERVER", /* 5 */
/* this is the name of a property on nxagent's window on the
real X server. This property is used for passing clipboard
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c
index 8ac2241a6..22fc96f4f 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c
@@ -2237,6 +2237,7 @@ Bool nxagentInitClipboard(WindowPtr pWin)
nxagentXFixesInfo.Initialized = True;
}
+#ifdef NXAGENT_ONSTART
/*
The first paste from CLIPBOARD did not work directly after
session start. Removing this code makes it work. It is unsure why
@@ -2247,6 +2248,7 @@ Bool nxagentInitClipboard(WindowPtr pWin)
if (nxagentSessionId[0])
{
+ // nxagentAtoms[10] is the CLIPBOARD atom
#ifdef TEST
fprintf(stderr, "%s: setting the ownership of %s to %lx"
" and registering for PropertyChangeMask events\n", __func__,
@@ -2258,6 +2260,7 @@ Bool nxagentInitClipboard(WindowPtr pWin)
nxagentChangeWindowAttributes(pWin, CWEventMask);
}
*/
+#endif
if (nxagentReconnectTrap)
{
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c b/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c
index e6d3ce6ec..58c1fc4e2 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c
@@ -503,12 +503,14 @@ Bool nxagentReconnectSession(void)
nxagentMapDefaultWindows();
+#ifdef NXAGENT_ONSTART
/*
* Ensure that the SetSelectionOwner request is sent through the
* link.
*/
XFlush(nxagentDisplay);
+#endif
NXTransContinue(NULL);
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Screen.c b/nx-X11/programs/Xserver/hw/nxagent/Screen.c
index b87c1e225..500006868 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Screen.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Screen.c
@@ -1865,6 +1865,7 @@ N/A
(unsigned char*) "X-AGENT",
strlen("X-AGENT"));
}
+#endif
XSelectInput(nxagentDisplay, nxagentFullscreenWindow, nxagentGetDefaultEventMask());
}
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Splash.c b/nx-X11/programs/Xserver/hw/nxagent/Splash.c
index 37f965f04..a4dfb73d2 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Splash.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Splash.c
@@ -344,6 +344,7 @@ void nxagentRemoveSplashWindow(void)
nxagentSplashWindow = None;
nxagentRefreshWindows(screenInfo.screens[0]->root);
+#ifdef NXAGENT_ONSTART
#ifdef TEST
fprintf(stderr, "%s: setting the ownership of %s (%d) on window [0x%lx]\n", __func__,
"NX_CUT_BUFFER_SERVER", (int)serverTransToAgentProperty, nxagentWindow(screenInfo.screens[0]->root));
@@ -351,6 +352,7 @@ void nxagentRemoveSplashWindow(void)
XSetSelectionOwner(nxagentDisplay, serverTransToAgentProperty,
nxagentWindow(screenInfo.screens[0]->root), CurrentTime);
+#endif
}
if (nxagentPixmapLogo)
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Window.c b/nx-X11/programs/Xserver/hw/nxagent/Window.c
index 5f12fd48a..00439d2e0 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Window.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Window.c
@@ -2575,12 +2575,14 @@ void nxagentMapDefaultWindows(void)
}
}
+#ifdef NXAGENT_ONSTART
/*
* Send a SetSelectionOwner request to notify of the agent start.
*/
XSetSelectionOwner(nxagentDisplay, serverTransToAgentProperty,
nxagentDefaultWindows[i], CurrentTime);
+#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