-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nxagent: add keystrokes to switch clipboard mode on the fly #1047
base: 3.6.x
Are you sure you want to change the base?
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.