diff options
author | Tiago Vignatti <tiagov@balalaika.(none)> | 2007-08-07 01:39:29 -0300 |
---|---|---|
committer | Tiago Vignatti <tiagov@balalaika.(none)> | 2007-08-07 01:39:29 -0300 |
commit | 955d5f6c0d14fae63bfe7c4ab39ee0a708919479 (patch) | |
tree | 4d61a0cab12806bb81640b3627d5f451c3260fd6 | |
parent | aa3c6aaaab213200591d29ddb2921adfb87ee5b4 (diff) |
When we call Xephyr with '-pointer' a new pointer is added inside the server
and the Xephyr virtual mouse keeps alive. With this patch the semantic changes
turning '-pointer' && 'Xephyr virtual mouse' always false.
Now we can open a device pointer and pass its options in Xephyr's command line
without having other pointer unused.
-rw-r--r-- | hw/kdrive/ephyr/ephyrinit.c | 29 | ||||
-rw-r--r-- | hw/kdrive/src/kdrive.c | 4 |
2 files changed, 22 insertions, 11 deletions
diff --git a/hw/kdrive/ephyr/ephyrinit.c b/hw/kdrive/ephyr/ephyrinit.c index 45e2d3067..850dc76dc 100644 --- a/hw/kdrive/ephyr/ephyrinit.c +++ b/hw/kdrive/ephyr/ephyrinit.c @@ -30,6 +30,8 @@ extern Window EphyrPreExistingHostWin; extern Bool EphyrWantGrayScale; +extern Bool kdHasPointer; +extern Bool kdHasKbd; void InitCard (char *name) @@ -54,19 +56,24 @@ InitInput (int argc, char **argv) KdKeyboardInfo *ki; KdPointerInfo *pi; - ki = KdNewKeyboard(); - if (!ki) - FatalError("Couldn't create Xephyr keyboard\n"); - ki->driver = &EphyrKeyboardDriver; KdAddKeyboardDriver(&EphyrKeyboardDriver); - KdAddKeyboard(ki); - - pi = KdNewPointer(); - if (!pi) - FatalError("Couldn't create Xephyr pointer\n"); - pi->driver = &EphyrMouseDriver; KdAddPointerDriver(&EphyrMouseDriver); - KdAddPointer(pi); + + if (!kdHasKbd) { + ki = KdNewKeyboard(); + if (!ki) + FatalError("Couldn't create Xephyr keyboard\n"); + ki->driver = &EphyrKeyboardDriver; + KdAddKeyboard(ki); + } + + if (!kdHasPointer) { + pi = KdNewPointer(); + if (!pi) + FatalError("Couldn't create Xephyr pointer\n"); + pi->driver = &EphyrMouseDriver; + KdAddPointer(pi); + } KdInitInput(); } diff --git a/hw/kdrive/src/kdrive.c b/hw/kdrive/src/kdrive.c index 8653d72a2..5158ef5fe 100644 --- a/hw/kdrive/src/kdrive.c +++ b/hw/kdrive/src/kdrive.c @@ -81,6 +81,8 @@ int kdVirtualTerminal = -1; Bool kdSwitchPending; char *kdSwitchCmd; DDXPointRec kdOrigin; +Bool kdHasPointer = FALSE; +Bool kdHasKbd = FALSE; static Bool kdCaughtSignal = FALSE; @@ -737,12 +739,14 @@ KdProcessArgument (int argc, char **argv, int i) if (i + 1 >= argc) UseMsg(); KdAddConfigPointer(argv[i + 1]); + kdHasPointer = TRUE; return 2; } if (!strcmp (argv[i], "-keybd")) { if (i + 1 >= argc) UseMsg(); KdAddConfigKeyboard(argv[i + 1]); + kdHasKbd = TRUE; return 2; } |