<p dir="ltr"><br>
Em 9 de fev de 2016 02:24, "Peter Hutterer" <<a href="mailto:peter.hutterer@who-t.net">peter.hutterer@who-t.net</a>> escreveu:<br>
><br>
> On Fri, Dec 11, 2015 at 11:43:10AM -0200, Laércio de Sousa wrote:<br>
> > This patch introduces convenient command-line options -xkbrules,<br>
> > -xkbmodel, -xkblayout, -xkbvariant, and -xkboptions, to set default<br>
> > values for these properties.<br>
> ><br>
> > These options can be handful in cases where corresponding values can't<br>
> > be taken from devices' udev properties, and compile-time default<br>
> > values don't match user locale.<br>
> ><br>
> > Signed-off-by: Laércio de Sousa <<a href="mailto:laerciosousa@sme-mogidascruzes.sp.gov.br">laerciosousa@sme-mogidascruzes.sp.gov.br</a>><br>
> > ---<br>
> > hw/kdrive/src/kdrive.c | 40 ++++++++++++++++++++++++++++++++++++++++<br>
> > hw/kdrive/src/kinput.c | 16 +++++++++++-----<br>
> > 2 files changed, 51 insertions(+), 5 deletions(-)<br>
> ><br>
> > diff --git a/hw/kdrive/src/kdrive.c b/hw/kdrive/src/kdrive.c<br>
> > index 8930ace..1578458 100644<br>
> > --- a/hw/kdrive/src/kdrive.c<br>
> > +++ b/hw/kdrive/src/kdrive.c<br>
> > @@ -85,6 +85,11 @@ char *kdSwitchCmd;<br>
> > DDXPointRec kdOrigin;<br>
> > Bool kdHasPointer = FALSE;<br>
> > Bool kdHasKbd = FALSE;<br>
> > +const char *kdGlobalXkbRules = NULL;<br>
> > +const char *kdGlobalXkbModel = NULL;<br>
> > +const char *kdGlobalXkbLayout = NULL;<br>
> > +const char *kdGlobalXkbVariant = NULL;<br>
> > +const char *kdGlobalXkbOptions = NULL;<br>
> ><br>
> > static Bool kdCaughtSignal = FALSE;<br>
> ><br>
> > @@ -451,6 +456,11 @@ KdUseMsg(void)<br>
> > ("-mouse driver [,n,,options] Specify the pointer driver and its options (n is the number of buttons)\n");<br>
> > ErrorF<br>
> > ("-keybd driver [,,options] Specify the keyboard driver and its options\n");<br>
> > + ErrorF("-xkbrules Set default XkbRules value (can be overriden by -keybd options)\n");<br>
> > + ErrorF("-xkbmodel Set default XkbModel value (can be overriden by -keybd options)\n");<br>
> > + ErrorF("-xkblayout Set default XkbLayout value (can be overriden by -keybd options)\n");<br>
> > + ErrorF("-xkbvariant Set default XkbVariant value (can be overriden by -keybd options)\n");<br>
> > + ErrorF("-xkboptions Set default XkbOptions value (can be overriden by -keybd options)\n");<br>
> > ErrorF("-zaphod Disable cursor screen switching\n");<br>
> > ErrorF("-2button Emulate 3 button mouse\n");<br>
> > ErrorF("-3button Disable 3 button mouse emulation\n");<br>
> > @@ -559,6 +569,36 @@ KdProcessArgument(int argc, char **argv, int i)<br>
> > sscanf(argv[i], "vt%2d", &kdVirtualTerminal) == 1) {<br>
> > return 1;<br>
> > }<br>
> > + if (!strcmp(argv[i], "-xkbrules")) {<br>
> > + if (i + 1 >= argc)<br>
> > + UseMsg();<br>
><br>
> afaict UseMsg() doesn't actually exist, so you're accessing invalid memory<br>
> here.<br>
Many other kdrive-related command-line options call UseMsg() as well --- which in turn calls KdUseMsg().</p>
<p dir="ltr">Att.</p>