nxagent: add keystrokes to switch clipboard mode on the fly#1047
nxagent: add keystrokes to switch clipboard mode on the fly#1047xavierog wants to merge 5 commits intoArcticaProject:3.6.xfrom
Conversation
|
I am sorry that you did not get a reaction to this so far - I just detected it today and will have a look at it |
uli42
left a comment
There was a problem hiding this comment.
I don't see code that (re-)initializes the clipboard when switching between modes. This might especially become important when nxagent was started with clipboard=none initially.
Also we need a way to disable the keystrokes since the feature might compromise security (if the admin sets the clipboard to some mode in the global config it should not be possible for the user to enable it on the fly.
| case doClipboardServer: | ||
| case doClipboardNone: | ||
| { | ||
| nxagentSwitchClipboardMode(ClipboardBoth + result - doClipboardBoth); |
There was a problem hiding this comment.
I don't really like that calculation since it is not self-explanatory. Please add at least a comment the thought behind this calculation. There's another location where I saw that same calculation, comment there too, please
| case KEYSTROKE_SET_CLIPBOARD_CLIENT: | ||
| case KEYSTROKE_SET_CLIPBOARD_SERVER: | ||
| case KEYSTROKE_SET_CLIPBOARD_NONE: | ||
| *result = doClipboardBoth + stroke - KEYSTROKE_SET_CLIPBOARD_BOTH; |
There was a problem hiding this comment.
explain calculation (as mentioned above)
|
@xavierog Can you please give feedback on the questions asks in the code review of this PR? Thanks. @uli42 I @xavierog will not respond, I think the idea of being able to switch between clipboard modes is basically great, but we should add yet another option that enables/disables this feature server-side/client-side. Disabled clipboard (by admin / by client user) is a feature and we would undermine it here. What do you think? |
|
Hi! |
|
@xavierog This is awesome to hear!!! |
|
I agree that it is a nice feature. We could even extend it to a mode where only one clipboard action is allowed (pasting once) and afterwards it is disabled again. This way you get a bit more security. |
This pull request adds nxagent keystrokes to switch clipboard mode on the fly.
A typical use case for this feature is to prevent access to the real X server's clipboard most of the time, except for a couple seconds when this actually proves necessary. Otherly put, it simply makes nxagent's"clipboard mode" feature more flexible. Should it prove unnecessary or harmful to some users, the whole thing can be disabled by reconfiguring keystrokes.