Add force_xinerama configuration option

The configuration option does the same as the commandline parameter, except
it can be easily set by the user (e.g. you are using KDM and can't start a
session through ~/.xsession).

Signed-off-by: Michael Walle <michael@walle.cc>
This commit is contained in:
Michael Walle 2011-09-19 22:43:25 +02:00 committed by Michael Stapelberg
parent 0c51b57b99
commit 5aa43d61f8
4 changed files with 25 additions and 1 deletions

View File

@ -123,6 +123,16 @@ struct Config {
* more often. */ * more often. */
bool force_focus_wrapping; bool force_focus_wrapping;
/** By default, use the RandR API for multi-monitor setups.
* Unfortunately, the nVidia binary graphics driver doesn't support
* this API. Instead, it only support the less powerful Xinerama API,
* which can be enabled by this option.
*
* Note: this option takes only effect on the initial startup (eg.
* reconfiguration is not possible). On startup, the list of screens
* is fetched once and never updated. */
bool force_xinerama;
/** The default border style for new windows. */ /** The default border style for new windows. */
border_style_t default_border; border_style_t default_border;

View File

@ -125,6 +125,7 @@ none { return TOK_NONE; }
1pixel { return TOK_1PIXEL; } 1pixel { return TOK_1PIXEL; }
focus_follows_mouse { return TOKFOCUSFOLLOWSMOUSE; } focus_follows_mouse { return TOKFOCUSFOLLOWSMOUSE; }
force_focus_wrapping { return TOK_FORCE_FOCUS_WRAPPING; } force_focus_wrapping { return TOK_FORCE_FOCUS_WRAPPING; }
force_xinerama { return TOK_FORCE_XINERAMA; }
workspace_bar { return TOKWORKSPACEBAR; } workspace_bar { return TOKWORKSPACEBAR; }
popup_during_fullscreen { return TOK_POPUP_DURING_FULLSCREEN; } popup_during_fullscreen { return TOK_POPUP_DURING_FULLSCREEN; }
ignore { return TOK_IGNORE; } ignore { return TOK_IGNORE; }

View File

@ -619,6 +619,7 @@ void parse_file(const char *f) {
%token TOK_1PIXEL "1pixel" %token TOK_1PIXEL "1pixel"
%token TOKFOCUSFOLLOWSMOUSE "focus_follows_mouse" %token TOKFOCUSFOLLOWSMOUSE "focus_follows_mouse"
%token TOK_FORCE_FOCUS_WRAPPING "force_focus_wrapping" %token TOK_FORCE_FOCUS_WRAPPING "force_focus_wrapping"
%token TOK_FORCE_XINERAMA "force_xinerama"
%token TOKWORKSPACEBAR "workspace_bar" %token TOKWORKSPACEBAR "workspace_bar"
%token TOK_DEFAULT "default" %token TOK_DEFAULT "default"
%token TOK_STACKING "stacking" %token TOK_STACKING "stacking"
@ -674,6 +675,7 @@ line:
| new_float | new_float
| focus_follows_mouse | focus_follows_mouse
| force_focus_wrapping | force_focus_wrapping
| force_xinerama
| workspace_bar | workspace_bar
| workspace | workspace
| assign | assign
@ -1022,6 +1024,14 @@ force_focus_wrapping:
} }
; ;
force_xinerama:
TOK_FORCE_XINERAMA bool
{
DLOG("force xinerama = %d\n", $2);
config.force_xinerama = $2;
}
;
workspace_bar: workspace_bar:
TOKWORKSPACEBAR bool TOKWORKSPACEBAR bool
{ {

View File

@ -432,7 +432,10 @@ int main(int argc, char *argv[]) {
free(greply); free(greply);
if (force_xinerama) { /* Force Xinerama (for drivers which don't support RandR yet, esp. the
* nVidia binary graphics driver), when specified either in the config
* file or on command-line */
if (force_xinerama || config.force_xinerama) {
xinerama_init(); xinerama_init();
} else { } else {
DLOG("Checking for XRandR...\n"); DLOG("Checking for XRandR...\n");