Skip to content
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

Open
wants to merge 5 commits into
base: 3.6.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions nx-X11/programs/Xserver/hw/nxagent/Events.c
Original file line number Diff line number Diff line change
Expand Up @@ -1071,6 +1071,14 @@ void nxagentDispatchEvents(PredicateFuncPtr predicate)
nxagentDumpClipboardStat();
break;
}
case doClipboardBoth:
case doClipboardClient:
case doClipboardServer:
case doClipboardNone:
{
nxagentSwitchClipboardMode(ClipboardBoth + result - doClipboardBoth);
Copy link
Member

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

break;
}
default:
{
FatalError("nxagentDispatchEvent: handleKeyPress returned unknown value\n");
Expand Down
6 changes: 5 additions & 1 deletion nx-X11/programs/Xserver/hw/nxagent/Events.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,11 @@ enum HandleEventResult
doSwitchResizeMode,
doSwitchDeferMode,
doAutoGrab,
doDumpClipboard
doDumpClipboard,
doClipboardBoth,
doClipboardClient,
doClipboardServer,
doClipboardNone
};

extern CARD32 nxagentLastEventTime;
Expand Down