From 7358581d7726c132a2c0b0d80b1e12b282b0aca3 Mon Sep 17 00:00:00 2001 From: Ulrich Sibiller Date: Mon, 17 Feb 2020 14:36:11 +0100 Subject: NXdispatch.c: move nxagentClearClipboard to client callback --- nx-X11/programs/Xserver/hw/nxagent/Client.c | 2 ++ nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c | 15 +++------------ 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Client.c b/nx-X11/programs/Xserver/hw/nxagent/Client.c index 020f90c91..78b9d46ec 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Client.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Client.c @@ -52,6 +52,7 @@ #include "Events.h" #include "Drawable.h" #include "Utils.h" +#include "Clipboard.h" /* * Need to include this after the stub definition of GC in Agent.h. @@ -150,6 +151,7 @@ void nxagentClientStateCallback(CallbackListPtr *callbacks, void *data, void *ar } case ClientStateGone: { + nxagentClearClipboard(client, NULL); freeClientPrivates(client); break; } diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c b/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c index 58dd71f60..8d0fa7549 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c @@ -989,23 +989,14 @@ CloseDownClient(register ClientPtr client) { #ifdef NXAGENT_SERVER /* - * There must be a better way to hook a - * call-back function to be called any - * time a client is going to be closed. - */ - - nxagentClearClipboard(client, NULL); - - /* - * Need to reset the karma counter and - * get rid of the pending sync replies. + * Need to reset the karma counter and get rid of the pending sync + * replies. */ nxagentWakeupByReset(client); /* - * Check if the client - * is a shadow nxagent. + * Check if the client is a shadow nxagent. */ nxagentCheckIfShadowAgent(client); -- cgit v1.2.3