aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Clipboard.c: move comment to correct locationUlrich Sibiller2021-06-201-6/+6
|
* Clipboard.c: delete property before/after certain operationsUlrich Sibiller2021-06-201-0/+36
| | | | | | for ICCCM conformity Fixes ArcticaProject/nx-libs#969
* Clipboard.c: improve debugging output once moreUlrich Sibiller2021-06-201-2/+14
|
* Clipboard.c: do not handle unknown selections in Callback handlerUlrich Sibiller2021-06-201-4/+15
|
* Clipboard.c: limit selection nxagentFindCurrentSelectionIndex can returnUlrich Sibiller2021-06-201-1/+15
| | | | | | | | | | | | | | | | | Normally you'd expect the loop going up to NumCurrentSelections. But the dix code will increase that number (but not nxagentMaxSelections) when drag and drop comes into play. In that case this helper will report a match for other selections than the ones the clipboard code knows about. The subsequent code will then use a higher index which will lead to out of range data reads (and writes!). Therefore we take nxagentMaxSelections here. The startup code ensures that both arrays will refer to the same selection for the first nxagentMaxSelections selection atoms. This way the clipboard code will not kick in for drag and drop resources. Fixes ArcticaProject/nx-libs#986
* Clipboard.c: rework nxagentFind*SelectionIndex() helpersUlrich Sibiller2021-06-203-14/+16
| | | | Let them return -1 which makes it easier to check for successful execution.
* Clipboard.c: make index the first argument everywhereUlrich Sibiller2021-06-201-34/+34
|
* Clipboard.c: move property transfer to separate functionUlrich Sibiller2021-06-201-112/+118
|
* Clipboard.c: extend target caching for the other directionUlrich Sibiller2021-06-201-17/+76
| | | | | | | | | | This may seem unneccessary at first sight because we are only talking to our own clients which generally is quick. But if you are using nested nx sessions or clients from remote machines (e.g. via ssh X forwarding) this still can save some lenghty communication. Plus: it helps in debugging because there are fewer messages being sent around.
* Clipboard.c: add another FIXMEUlrich Sibiller2021-06-201-1/+5
|
* Clipboard.c: cancel pending requests in certain situationsUlrich Sibiller2021-06-201-6/+9
|
* Clipboard.c: introduce replyPendingRequestSelectionToXServer helperUlrich Sibiller2021-06-201-31/+39
|
* Clipboard.c: move some (currently commented) code to inner scopeUlrich Sibiller2021-06-201-3/+3
|
* Events.c: use already available variable instead of repeating conversionUlrich Sibiller2021-06-201-1/+1
|
* Clipboard.c: reset lastServer[].requestor on reconnectUlrich Sibiller2021-06-201-4/+10
|
* Clipboard.c: improve some commentsUlrich Sibiller2021-06-201-9/+5
|
* Clipboard.c: implement target cachingUlrich Sibiller2021-06-201-0/+118
| | | | | | | | | | | | | | | | | | | | | | Some applications (e.g. Chrome, Firefox) send multiple TARGETS requests when they want to paste a selection (reason currently unknown). If such an application runs in an NX session and the current clipboard owner is on the real X server this triggers many (superflous) roundtrips. By caching the first answer to those requests and answering subsequent requests from the cache we can eliminate all this communication. The implemention resulted from attempting to fix ArcticaProject/nx-libs/issues/#969 (solution 1a) but it turned out that the speedup this brings does not help in reducing the number of requests by firefox. It must be a bug in the firefox code. Nevertheless I kept the code as it should speed up the whole pasting process considerably while reducing communication over the wire. This also eliminates a memory leak in the target forwarding code which was unnoticed before.
* Clipboard.c: fix indentationUlrich Sibiller2021-06-201-4/+4
|
* Clipboard.c: correctly pass back failure to real X serverUlrich Sibiller2021-06-201-22/+46
|
* Clipboard.c: fix: return after denying requestUlrich Sibiller2021-06-201-0/+1
|
* Clipboard.c: remove obsolete FIXME commentUlrich Sibiller2021-06-201-5/+0
|
* Clipboard.c: once again improved DEBUG outputUlrich Sibiller2021-06-201-13/+34
| | | | | | | | Also reduce number of certain DEBUG lines: These PropertyEvents tend to appear quite often and most of the times they have nothing to do with the clipboard. So instead of printing them everytime we turn that around and print something only if it is a clipboard related event..
* Clipboard.c: fix: remove wrong optimizationUlrich Sibiller2021-06-201-14/+4
| | | | | | | | | | In the "none" case we must ensure the clipboard data is reset. This "optimization" skipped the reset part which made the code think it is waiting for an answer. Which (of course) never arrived. So any further request was rejected... Also reduce debugging output for the "none" case because resetClientSelectionStage will print it anyway.
* Clipboard.c: use NullClient instead of NULL where appropriateUlrich Sibiller2021-06-201-2/+2
|
* Events.c: use index instead of iUlrich Sibiller2021-06-201-7/+7
| | | | we do that everywhere when handling clipboard stuff
* Clipboard.c: fix transfer from agent to X serverUlrich Sibiller2021-06-201-1/+6
| | | | The code took the wrong path because of an insufficent check
* Clipboard.c: fix some whitepace, comments and FIXMEsUlrich Sibiller2021-06-201-5/+4
|
* Clipboard: init variableUlrich Sibiller2021-06-201-1/+6
|
* Clipboard.c: print separator when receiving events/requests in debug modeUlrich Sibiller2021-06-201-5/+5
| | | | This helps reading the debug output a lot!
* Clipboard.c: another round of debug improvementsUlrich Sibiller2021-06-201-19/+33
|
* Clipboard.c: replace loop by helperUlrich Sibiller2021-06-201-13/+1
|
* Clipboard.c: disable TEXT and COMPOUND_TEXTUlrich Sibiller2021-06-201-12/+77
| | | | They are ancient and their use is discouraged by ICCCM
* nxagent: add option -textclipboardUlrich Sibiller2021-06-205-7/+261
| | | | textclipboard=<bool> in the options file
* Clipboard.c: extend commentsUlrich Sibiller2021-06-201-3/+8
|
* Clipboard.c: add TARGET_SIZESUlrich Sibiller2021-06-203-2/+29
|
* Clipboard.c: add FIXMEsUlrich Sibiller2021-06-201-0/+4
|
* Clipboard.c: add some more selection atomsUlrich Sibiller2021-06-203-15/+145
| | | | | we currently do not support them but as they require a special treatment we need to know them and report an error if they appear.
* Clipboard.c: target forwarding (Part 2/2)Ulrich Sibiller2021-06-201-110/+98
| | | | | | Internal clients asking for the available targets for a selection will no longer get a predefined list but a the list of targets from the owning client on the real X server.
* Clipboard.c: target forwarding (Part 1/2)Ulrich Sibiller2021-06-201-180/+118
| | | | | | Clients on the real X server requesting the available targets for a selection will no longer get a predefined list but a the list of targets from the owning internal client.
* Clipboard.c: fix: use XlibWindow instead of WindowUlrich Sibiller2021-06-201-17/+17
|
* Clipboard.c: fix type in status outputUlrich Sibiller2021-06-201-2/+2
|
* Clipboard.c: avoid superflous atom conversionUlrich Sibiller2021-06-201-6/+4
|
* Atoms.c: ensure to always return a valid string...Ulrich Sibiller2021-06-202-53/+52
| | | | | | ... by providing NameFor(Int|Rem)Atom() macros This way we do not have to validate it at various other places.
* Clipboard.c: make use of the new helpers from Atoms.cUlrich Sibiller2021-06-201-113/+50
| | | | | This saves us from having to create intermediate strings and Xfreeing them again. Which can easily be forgotten, producing memleaks.
* Atoms.c: add helper to easily print Atom names in debuggingUlrich Sibiller2021-06-202-2/+62
|
* Clipboard.c: compact clipboard status outputUlrich Sibiller2021-06-201-45/+48
| | | | require less lines
* Clipboard.c: fix comment position and init array pointerUlrich Sibiller2021-06-201-2/+3
|
* Clipboard.c: drop clientCLIPBOARDUlrich Sibiller2021-06-201-14/+14
| | | | read the value from the intSelAtoms array instead
* Clipboard.c: move selection Atoms into separate arraysUlrich Sibiller2021-06-201-39/+49
| | | | | They really only change on startup and reconnect. Also with this change we now only have internal Atoms in the LastSelectionOwner array.
* Clipboard.c: rephrase FIXMEUlrich Sibiller2021-06-201-5/+11
|