From 0ab35f0a23e7a9df062358f51254b3e64c8ba2b6 Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Thu, 12 Jul 2012 02:00:43 +0100 Subject: Don't register two different XINERAMA extensions Prevent RRXinerama from activating if PseudoramiX is, so we don't get XINERAMA listed twice in the list of extensions. Maybe we can remove RRXinerama, just use PseudoramiX and register the screen with it? Signed-off-by: Jon TURNEY --- hw/xwin/InitOutput.c | 8 ++++++-- randr/rrxinerama.c | 5 +++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/hw/xwin/InitOutput.c b/hw/xwin/InitOutput.c index a1d92b1b4..5a6b78ffd 100644 --- a/hw/xwin/InitOutput.c +++ b/hw/xwin/InitOutput.c @@ -71,6 +71,8 @@ extern HWND g_hwndClipboard; extern Bool g_fClipboard; #endif +extern Bool noRRXineramaExtension; + /* * Function prototypes */ @@ -1047,15 +1049,17 @@ InitOutput (ScreenInfo *screenInfo, int argc, char *argv[]) } /* - Unless full xinerama has been explicitly enabled, register all native screens with pseduoramiX + Unless full xinerama has been explicitly enabled, register all native screens with pseudoramiX */ if (!noPanoramiXExtension) - noPseudoramiXExtension = TRUE; + noPseudoramiXExtension = TRUE; if ((g_ScreenInfo[0].fMultipleMonitors) && !noPseudoramiXExtension) { int pass; + noRRXineramaExtension = TRUE; + PseudoramiXExtensionInit(argc, argv); /* Add primary monitor on pass 0, other monitors on pass 1, to ensure diff --git a/randr/rrxinerama.c b/randr/rrxinerama.c index 6d4519043..2c1e857b0 100644 --- a/randr/rrxinerama.c +++ b/randr/rrxinerama.c @@ -84,6 +84,8 @@ static int ProcRRXineramaIsActive(ClientPtr client); static int ProcRRXineramaQueryScreens(ClientPtr client); static int SProcRRXineramaDispatch(ClientPtr client); +Bool noRRXineramaExtension = FALSE; + /* Proc */ int @@ -450,6 +452,9 @@ RRXineramaExtensionInit(void) return; #endif + if (noRRXineramaExtension) + return; + /* * Xinerama isn't capable enough to have multiple protocol screens each * with their own output geometry. So if there's more than one protocol -- cgit v1.2.3 From 58d6f159eac4a447297b60ef0d61ab8ccb3620fe Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Mon, 16 Jul 2012 15:03:01 +0100 Subject: hw/xwin: allow DPI configuration in XWinrc Signed-off-by: Yaakov Selkowitz --- hw/xwin/man/XWinrc.man | 5 +++++ hw/xwin/winconfig.c | 1 + hw/xwin/winconfig.h | 1 + hw/xwin/winprefslex.l | 1 + hw/xwin/winprefsyacc.y | 16 ++++++++++++++++ hw/xwin/winprocarg.c | 8 ++++++++ 6 files changed, 32 insertions(+) diff --git a/hw/xwin/man/XWinrc.man b/hw/xwin/man/XWinrc.man index 71d8dad23..820528730 100644 --- a/hw/xwin/man/XWinrc.man +++ b/hw/xwin/man/XWinrc.man @@ -53,6 +53,11 @@ There are four kinds of instructions: miscellaneous, menu, icon and style. .SH Miscellaneous instruction +.TP 8 +.B DPI \fIresolution\fP +Sets the resolution for all screens, in dots per inch. To be used when +the server cannot determine the screen size(s) from the hardware. + .TP 8 .B DEBUG \fIString\fP The \fIString\fP is printed to the XWin log file. diff --git a/hw/xwin/winconfig.c b/hw/xwin/winconfig.c index 4dbbe7ced..ee2bb2bd6 100644 --- a/hw/xwin/winconfig.c +++ b/hw/xwin/winconfig.c @@ -70,6 +70,7 @@ WinCmdlineRec g_cmdline = { #ifdef XWIN_XF86CONFIG NULL, /* keyboard */ #endif + FALSE, /* customDPI */ NULL, /* xkbRules */ NULL, /* xkbModel */ NULL, /* xkbLayout */ diff --git a/hw/xwin/winconfig.h b/hw/xwin/winconfig.h index 4699ca8ef..fd3fcbf1e 100644 --- a/hw/xwin/winconfig.h +++ b/hw/xwin/winconfig.h @@ -195,6 +195,7 @@ typedef struct #ifdef XWIN_XF86CONFIG char *keyboard; #endif + Bool customDPI; char *xkbRules; char *xkbModel; char *xkbLayout; diff --git a/hw/xwin/winprefslex.l b/hw/xwin/winprefslex.l index ba8aea696..1ce5d1add 100644 --- a/hw/xwin/winprefslex.l +++ b/hw/xwin/winprefslex.l @@ -92,6 +92,7 @@ DEBUG { return DEBUGOUTPUT; } RELOAD { return RELOAD; } TRAYICON { return TRAYICON; } SILENTEXIT { return SILENTEXIT; } +DPI { return DPI; } "{" { return LB; } "}" { return RB; } "\""[^\"\r\n]+"\"" { yylval.sVal = makestr(yytext+1); \ diff --git a/hw/xwin/winprefsyacc.y b/hw/xwin/winprefsyacc.y index 0acf160e4..e6bb124a6 100644 --- a/hw/xwin/winprefsyacc.y +++ b/hw/xwin/winprefsyacc.y @@ -38,6 +38,8 @@ #include #include #include +#include "globals.h" +#include "winconfig.h" #include "winprefs.h" /* The following give better error messages in bison at the cost of a few KB */ @@ -56,6 +58,8 @@ static MENUPARSED menu; /* Functions for parsing the tokens into out structure */ /* Defined at the end section of this file */ +static void SetDPI (char *dpi); + static void SetIconDirectory (char *path); static void SetDefaultIcon (char *fname); static void SetRootMenu (char *menu); @@ -120,6 +124,7 @@ extern int yylex(void); %token TRAYICON %token FORCEEXIT %token SILENTEXIT +%token DPI %token STRING %type group1 @@ -154,6 +159,10 @@ command: defaulticon | trayicon | forceexit | silentexit + | dpi + ; + +dpi: DPI STRING NEWLINE { SetDPI($2); free($2); } ; trayicon: TRAYICON STRING NEWLINE { SetTrayIcon($2); free($2); } @@ -260,6 +269,13 @@ yyerror (char *s) return 1; } +static void +SetDPI (char *dpi) +{ + if (!g_cmdline.customDPI) + monitorResolution = atoi (dpi); +} + /* Miscellaneous functions to store TOKENs into the structure */ static void SetIconDirectory (char *path) diff --git a/hw/xwin/winprocarg.c b/hw/xwin/winprocarg.c index 1b539c025..a6f491049 100644 --- a/hw/xwin/winprocarg.c +++ b/hw/xwin/winprocarg.c @@ -995,6 +995,14 @@ ddxProcessArgument (int argc, char *argv[], int i) return 0; /* Let DIX parse this again */ } + /* + * Look for the '-dpi' argument + */ + if (IS_OPTION("-dpi")) { + g_cmdline.customDPI = TRUE; + return 0; /* Let DIX parse this again */ + } + /* * Look for the '-config' argument */ -- cgit v1.2.3 From 56574a16d67a6ff1c07cb1504ecbc5cebea3c2fc Mon Sep 17 00:00:00 2001 From: Yaakov Selkowitz Date: Tue, 10 Jul 2012 05:40:39 -0500 Subject: hw/xwin: allow XKB configuration in XWinrc Signed-off-by: Yaakov Selkowitz --- hw/xwin/man/XWinrc.man | 24 ++++++++++++++++ hw/xwin/winprefslex.l | 5 ++++ hw/xwin/winprefsyacc.y | 75 ++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 104 insertions(+) diff --git a/hw/xwin/man/XWinrc.man b/hw/xwin/man/XWinrc.man index 820528730..0f641e92f 100644 --- a/hw/xwin/man/XWinrc.man +++ b/hw/xwin/man/XWinrc.man @@ -58,6 +58,30 @@ There are four kinds of instructions: miscellaneous, menu, icon and style. Sets the resolution for all screens, in dots per inch. To be used when the server cannot determine the screen size(s) from the hardware. +.TP 8 +.B XKBLayout \fIlayout\fP +.TP 8 +.B XKBModel \fImodel\fP +.TP 8 +.B XKBOptions \fIoption\fP +.TP 8 +.B XKBRules \fIrule\fP +.TP 8 +.B XKBVariant \fIvariant\fp +These options configure the xkeyboard extension to load a particular +keyboard map as the X server starts. The behavior is similar to the +\fIsetxkbmap\fP(1) program. + +See the \fIxkeyboard-config\fP(__miscmansuffix__) manual page for a list of +keyboard configurations. + +Alternatively, you can use \fIsetxkbmap\fP(1) program after \fIXWin\fP +is running. + +The default is to select a keyboard configuration matching your current +layout as reported by \fIWindows\fP, if known, or the default X server +configuration if no matching keyboard configuration was found. + .TP 8 .B DEBUG \fIString\fP The \fIString\fP is printed to the XWin log file. diff --git a/hw/xwin/winprefslex.l b/hw/xwin/winprefslex.l index 1ce5d1add..f3d988c5b 100644 --- a/hw/xwin/winprefslex.l +++ b/hw/xwin/winprefslex.l @@ -93,6 +93,11 @@ RELOAD { return RELOAD; } TRAYICON { return TRAYICON; } SILENTEXIT { return SILENTEXIT; } DPI { return DPI; } +XKBLAYOUT { return XKBLAYOUT; } +XKBMODEL { return XKBMODEL; } +XKBOPTIONS { return XKBOPTIONS; } +XKBRULES { return XKBRULES; } +XKBVARIANT { return XKBVARIANT; } "{" { return LB; } "}" { return RB; } "\""[^\"\r\n]+"\"" { yylval.sVal = makestr(yytext+1); \ diff --git a/hw/xwin/winprefsyacc.y b/hw/xwin/winprefsyacc.y index e6bb124a6..f71969746 100644 --- a/hw/xwin/winprefsyacc.y +++ b/hw/xwin/winprefsyacc.y @@ -59,6 +59,11 @@ static MENUPARSED menu; /* Defined at the end section of this file */ static void SetDPI (char *dpi); +static void SetXKBLayout (char *layout); +static void SetXKBModel (char *model); +static void SetXKBOptions (char *options); +static void SetXKBRules (char *rules); +static void SetXKBVariant (char *variant); static void SetIconDirectory (char *path); static void SetDefaultIcon (char *fname); @@ -125,6 +130,11 @@ extern int yylex(void); %token FORCEEXIT %token SILENTEXIT %token DPI +%token XKBLAYOUT +%token XKBMODEL +%token XKBOPTIONS +%token XKBRULES +%token XKBVARIANT %token STRING %type group1 @@ -160,11 +170,31 @@ command: defaulticon | forceexit | silentexit | dpi + | xkblayout + | xkbmodel + | xkboptions + | xkbrules + | xkbvariant ; dpi: DPI STRING NEWLINE { SetDPI($2); free($2); } ; +xkblayout: XKBLAYOUT STRING NEWLINE { SetXKBLayout($2); } + ; + +xkbmodel: XKBMODEL STRING NEWLINE { SetXKBModel($2); } + ; + +xkboptions: XKBOPTIONS STRING NEWLINE { SetXKBOptions($2); } + ; + +xkbrules: XKBRULES STRING NEWLINE { SetXKBRules($2); } + ; + +xkbvariant: XKBVARIANT STRING NEWLINE { SetXKBVariant($2); } + ; + trayicon: TRAYICON STRING NEWLINE { SetTrayIcon($2); free($2); } ; @@ -276,6 +306,51 @@ SetDPI (char *dpi) monitorResolution = atoi (dpi); } +static void +SetXKBLayout (char *layout) +{ + if (!g_cmdline.xkbLayout) + g_cmdline.xkbLayout = layout; + else + free (layout); +} + +static void +SetXKBModel (char *model) +{ + if (!g_cmdline.xkbModel) + g_cmdline.xkbModel = model; + else + free (model); +} + +static void +SetXKBOptions (char *options) +{ + if (!g_cmdline.xkbOptions) + g_cmdline.xkbOptions = options; + else + free (options); +} + +static void +SetXKBRules (char *rules) +{ + if (!g_cmdline.xkbRules) + g_cmdline.xkbRules = rules; + else + free (rules); +} + +static void +SetXKBVariant (char *variant) +{ + if (!g_cmdline.xkbVariant) + g_cmdline.xkbVariant = variant; + else + free (variant); +} + /* Miscellaneous functions to store TOKENs into the structure */ static void SetIconDirectory (char *path) -- cgit v1.2.3