[PATCH xserver] Xdmx: fix input driver initialization code paths

Raimonds Cicans ray at apollo.lv
Mon Nov 6 13:26:33 UTC 2017


Problem: Xdmx exit with error "(Fatal Error) dmx: Unknown input argument: "
if local input driver is specified (example: -input local,usb-kbd,usb-mou).

Cause: code block for remote input drivers is placed in code path common
for all drivers.

Fix: affected code block moved to remote input driver code path part.

Signed-off-by: Raimonds Cicans <ray at apollo.lv>
---
 hw/dmx/input/dmxinputinit.c | 70 ++++++++++++++++++++++-----------------------
 1 file changed, 35 insertions(+), 35 deletions(-)

diff --git a/hw/dmx/input/dmxinputinit.c b/hw/dmx/input/dmxinputinit.c
index 6698181a9..25c7415b9 100644
--- a/hw/dmx/input/dmxinputinit.c
+++ b/hw/dmx/input/dmxinputinit.c
@@ -970,41 +970,6 @@ dmxInputInit(DMXInputInfo * dmxInput)
 
     a = dmxArgParse(dmxInput->name);
 
-    for (i = 1; i < dmxArgC(a); i++) {
-        switch (hasXkb) {
-        case 1:
-            dmxInput->keycodes = xstrdup(dmxArgV(a, i));
-            ++hasXkb;
-            break;
-        case 2:
-            dmxInput->symbols = xstrdup(dmxArgV(a, i));
-            ++hasXkb;
-            break;
-        case 3:
-            dmxInput->geometry = xstrdup(dmxArgV(a, i));
-            hasXkb = 0;
-            break;
-        case 0:
-            if (!strcmp(dmxArgV(a, i), "noxi"))
-                doXI = 0;
-            else if (!strcmp(dmxArgV(a, i), "xi"))
-                doXI = 1;
-            else if (!strcmp(dmxArgV(a, i), "console"))
-                forceConsole = 1;
-            else if (!strcmp(dmxArgV(a, i), "noconsole"))
-                forceConsole = 0;
-            else if (!strcmp(dmxArgV(a, i), "windows"))
-                doWindows = 1;
-            else if (!strcmp(dmxArgV(a, i), "nowindows"))
-                doWindows = 0;
-            else if (!strcmp(dmxArgV(a, i), "xkb"))
-                hasXkb = 1;
-            else {
-                dmxLog(dmxFatal, "Unknown input argument: %s\n", dmxArgV(a, i));
-            }
-        }
-    }
-
     name = dmxArgV(a, 0);
 
     if (!strcmp(name, "local")) {
@@ -1016,6 +981,41 @@ dmxInputInit(DMXInputInfo * dmxInput)
         dmxLogInput(dmxInput, "Using dummy input\n");
     }
     else {
+        for (i = 1; i < dmxArgC(a); i++) {
+            switch (hasXkb) {
+            case 1:
+                dmxInput->keycodes = xstrdup(dmxArgV(a, i));
+                ++hasXkb;
+                break;
+            case 2:
+                dmxInput->symbols = xstrdup(dmxArgV(a, i));
+                ++hasXkb;
+                break;
+            case 3:
+                dmxInput->geometry = xstrdup(dmxArgV(a, i));
+                hasXkb = 0;
+                break;
+            case 0:
+                if (!strcmp(dmxArgV(a, i), "noxi"))
+                    doXI = 0;
+                else if (!strcmp(dmxArgV(a, i), "xi"))
+                    doXI = 1;
+                else if (!strcmp(dmxArgV(a, i), "console"))
+                    forceConsole = 1;
+                else if (!strcmp(dmxArgV(a, i), "noconsole"))
+                    forceConsole = 0;
+                else if (!strcmp(dmxArgV(a, i), "windows"))
+                    doWindows = 1;
+                else if (!strcmp(dmxArgV(a, i), "nowindows"))
+                    doWindows = 0;
+                else if (!strcmp(dmxArgV(a, i), "xkb"))
+                    hasXkb = 1;
+                else {
+                    dmxLog(dmxFatal, "Unknown input argument: %s\n", dmxArgV(a, i));
+                }
+            }
+        }
+
         int found;
 
         for (found = 0, i = 0; i < dmxNumScreens; i++) {
-- 
2.13.6



More information about the xorg-devel mailing list