[PATCH] support for HW_SKIP_CONSOLE breaks use by blind people
Samuel Thibault
sthibault at debian.org
Sat Dec 29 19:09:51 PST 2012
Control: tags 696965 + patch
Hello,
Samuel Thibault, le Sun 30 Dec 2012 01:07:47 +0100, a écrit :
> I would have rather made it an option, and have made it not enabled
> by default, because the blind people who need the dummy driver do
> not necessarily have much technical knowledge beyond "use the dummy
> driver", while people who want to use the dummy driver with no VT most
> probably understand what that means, and would be able to enable the
> option.
Here is a patch proposal.
Samuel
Add OpenConsole option to dummy devices
This permits to choose whether the dummy device wants the console. The
driver will make the core open the console if at least one device wants
it.
Signed-off-by: Samuel Thibault <samuel.thibault at ens-lyon.org>
diff --git a/src/dummy_driver.c b/src/dummy_driver.c
index 6062c39..0ec5f4b 100644
--- a/src/dummy_driver.c
+++ b/src/dummy_driver.c
@@ -118,11 +118,13 @@ static SymTabRec DUMMYChipsets[] = {
};
typedef enum {
- OPTION_SW_CURSOR
+ OPTION_SW_CURSOR,
+ OPTION_OPEN_CONSOLE
} DUMMYOpts;
static const OptionInfoRec DUMMYOptions[] = {
{ OPTION_SW_CURSOR, "SWcursor", OPTV_BOOLEAN, {0}, FALSE },
+ { OPTION_OPEN_CONSOLE, "OpenConsole", OPTV_BOOLEAN, {0}, FALSE },
{ -1, NULL, OPTV_NONE, {0}, FALSE }
};
@@ -812,9 +814,36 @@ dummyDriverFunc(ScrnInfoPtr pScrn, xorgDriverFuncOp op, pointer ptr)
switch (op) {
case GET_REQUIRED_HW_INTERFACES:
+ {
+ Bool OpenConsole = FALSE;
+ GDevPtr *devSections;
+ int numDevSections, i;
+
+ /*
+ * Find the config file Device sections that match this
+ * driver
+ */
+ numDevSections = xf86MatchDevice(DUMMY_DRIVER_NAME, &devSections);
+
+ for (i = 0; i < numDevSections; i++) {
+ OptionInfoPtr Options;
+
+ if ((Options = malloc(sizeof(DUMMYOptions))))
+ {
+ Bool DeviceOpenConsole = TRUE;
+ memcpy(Options, DUMMYOptions, sizeof(DUMMYOptions));
+ xf86ProcessOptions(-1, devSections[i]->options, Options);
+ xf86GetOptValBool(Options, OPTION_OPEN_CONSOLE, &DeviceOpenConsole);
+ if (DeviceOpenConsole)
+ OpenConsole = TRUE;
+ free(Options);
+ }
+ }
+
flag = (CARD32*)ptr;
- (*flag) = HW_SKIP_CONSOLE;
+ (*flag) = OpenConsole ? 0 : HW_SKIP_CONSOLE;
return TRUE;
+ }
default:
return FALSE;
}
More information about the xorg-devel
mailing list