Copying text causes Emacs to hang for few seconds when it's running in a custom session
When making copy&paste operations from Emacs running in a custom session in floating window mode, text remains higlighted for some seconds instead of being immediately copied.
This problem occurs in custom sessions started from a NoMachine Windows client.
It has been reproduced with Emacs versions 25.1.1 and 27.1 and NoMachine versions v8.8, 8.7, 7.11 and 6.12.
Steps to reproduce:
1) Run Emacs in a NoMachine custom session started from Windows.
2) Copy some text in Windows (e.g. highlight a text in a browser and use Control-C, or highlight and right-click some text in a PowerShell window)
2) Select some text in the emacs window by left-clicking and dragging: this will highlight the text.
3) Use Alt-w to copy the highlighted test in the Emacs window.
The copy operation should be immediate while instead it hangs: the text remains highlighted for some seconds and then the highlighting disappears.
As a workaround, remove this setting:
(setq save-interprogram-paste-before-kill t)
from the ~/.emacs.d/init.el configuration file.
Otherwise, run Emacs in a custom session in virtual desktop mode, instead than floating window mode: select option 'Run the command in a virtual desktop' in the 'Custom session' UI.
