From c6aed6ad1db4d6bb01c5c5f8f53e5f2d42d443bb Mon Sep 17 00:00:00 2001 From: Ulrich Sibiller Date: Thu, 13 Feb 2020 23:22:52 +0100 Subject: Clipboard.c: clear windowPtr in ClearSelectionOwner There were two location where the windowPtr was not cleared after calling ClearSelectionOwner(). One was nxagentInitClipboard where it was set to NULL before and the second one was nxagentClearSelection() where it really should be reset. So we can safely move this to where it really belongs. --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index 074219097..4ccd2e45c 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -539,8 +539,8 @@ void nxagentClearSelectionOwner(int index) { lastSelectionOwner[index].client = NULL; lastSelectionOwner[index].window = None; + lastSelectionOwner[index].windowPtr = NULL; lastSelectionOwner[index].lastTimeChanged = GetTimeInMillis(); - /* FIXME: why is windowPtr not cleared in the function? */ } void nxagentStoreSelectionOwner(int index, Selection *sel) @@ -579,9 +579,7 @@ void nxagentClearClipboard(ClientPtr pClient, WindowPtr pWindow) (void *) pClient, (void *) pWindow); #endif - /* FIXME: why is windowPtr not cleared in the function? */ nxagentClearSelectionOwner(i); - lastSelectionOwner[i].windowPtr = NULL; lastClientWindowPtr = NULL; SetClientSelectionStage(None); @@ -1510,7 +1508,6 @@ void nxagentResetSelectionOwner(void) #endif nxagentClearSelectionOwner(i); - lastSelectionOwner[i].windowPtr = NULL; } lastClientWindowPtr = NULL; -- cgit v1.2.3