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

Pr/autograb #393

Open
wants to merge 14 commits into
base: 3.6.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
6 changes: 6 additions & 0 deletions doc/nxagent/README.keystrokes
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,12 @@ reread_keystrokes
Forces nxagent to re-read the keystroke configuration. Useful to
add/change keystrokes to a running session.

autograb
Toggles autograb mode

lockinput
Locks/unlocsk pointer within nxagent window

force_synchronization
Forces immediate drawing of elements to be synchronized which can
fix some visual bugs.
2 changes: 2 additions & 0 deletions etc/keystrokes.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,6 @@
<keystroke action="viewport_scroll_down" Control="1" AltMeta="1" key="Down" />
<keystroke action="viewport_scroll_down" Control="1" AltMeta="1" key="KP_Down" />
<keystroke action="reread_keystrokes" Control="1" AltMeta="1" key="k" />
<keystroke action="autograb" Control="1" AltMeta="1" key="g" />
<keystroke action="inputlock" Control="1" AltMeta="1" key="c" />
</keystrokes>
43 changes: 43 additions & 0 deletions nx-X11/programs/Xserver/hw/nxagent/Args.c
Original file line number Diff line number Diff line change
Expand Up @@ -1041,6 +1041,21 @@ int ddxProcessArgument(int argc, char *argv[], int i)
return 0;
}

if (!strcmp(argv[i], "-autograb"))
{
nxagentChangeOption(AutoGrab, True);

return 1;
}

if (!strcmp(argv[i], "-inputlock"))
{
nxagentChangeOption(InputLock, True);

return 1;
}


/*
* Disable Xinerama (i.e. fake it in Screen.c) if somehow Xinerama support
* has been disabled on the cmdline.
Expand Down Expand Up @@ -1541,6 +1556,32 @@ static void nxagentParseSingleOption(char *name, char *value)

return;
}
else if (!strcmp(name, "autograb"))
{
if (!strcmp(value, "0"))
{
nxagentChangeOption(AutoGrab, False);
}
else
{
nxagentChangeOption(AutoGrab, True);
}

return;
}
else if (!strcmp(name, "inputlock"))
{
if (!strcmp(value, "0"))
{
nxagentChangeOption(InputLock, False);
}
else
{
nxagentChangeOption(InputLock, True);
}

return;
}
else
{
#ifdef DEBUG
Expand Down Expand Up @@ -2197,6 +2238,8 @@ void ddxUseMsg(void)
ErrorF("-noignore don't ignore pointer and keyboard configuration changes mandated by clients\n");
ErrorF("-nokbreset don't reset keyboard device if the session is resumed\n");
ErrorF("-noxkblock always allow applications to change layout through XKEYBOARD\n");
ErrorF("-autograb enable autograb\n");
ErrorF("-inputlock enable inputlock\n");
ErrorF("-tile WxH size of image tiles (minimum allowed: 32x32)\n");
ErrorF("-keystrokefile file file with keyboard shortcut definitions\n");
ErrorF("-verbose print more warning and error messages\n");
Expand Down
Loading