Add --sync option

This commit is contained in:
Julien Danjou 2008-03-16 11:31:38 +01:00
parent dbe2052320
commit 2c0b68cd4e
2 changed files with 25 additions and 10 deletions

View File

@ -9,7 +9,10 @@ awesome - awesome window manager
SYNOPSIS
--------
awesome [-v | --version] [-c configuration file]
awesome [ -v | --version ]
awesome [ -h | --help ]
awesome [ -k | --check ] [ -c configuration file ]
awesome [ -s | --sync ] [ -c configuration file ]
DESCRIPTION
-----------
@ -42,13 +45,16 @@ awesome can draw a small border around windows to indicate the focus state.
OPTIONS
-------
-v | --version::
prints version information to standard output, then exits.
Prints version information to standard output, then exits.
-h | --help::
prints help information, then exits.
-c::
use an alternate configuration file instead of $HOME/.awesomerc.
-k::
check configuration file syntax.
Prints help information, then exits.
--config || -c::
Use an alternate configuration file instead of $HOME/.awesomerc.
--check | -k::
Check configuration file syntax.
--sync | -s::
Enable X11 synchronization mode. All X11 calls will be synchronized,
so you can break on exit to retrieve a backtrace of X errors.
DEFAULTS MOUSE BINDINGS
-----------------------

View File

@ -169,7 +169,8 @@ exit_help(int exit_code)
-h, --help show help\n\
-v, --version show version\n\
-c, --config FILE configuration file to use\n\
-k, --check check configuration file syntax\n");
-k, --check check configuration file syntax\n\
-s --sync enable synchronization (X debug)\n");
exit(exit_code);
}
@ -194,12 +195,14 @@ main(int argc, char *argv[])
struct sockaddr_un *addr;
Client *c;
XSetWindowAttributes wa;
Bool xsync = False;
static struct option long_options[] =
{
{"help", 0, NULL, 'h'},
{"version", 0, NULL, 'v'},
{"check", 0, NULL, 'k'},
{"config", 0, NULL, 'c'},
{"config", 1, NULL, 'c'},
{"sync", 0, NULL, 's'},
{NULL, 0, NULL, 0}
};
@ -217,7 +220,7 @@ main(int argc, char *argv[])
}
/* check args */
while((opt = getopt_long(argc, argv, "vhkc:",
while((opt = getopt_long(argc, argv, "vhkcs:",
long_options, NULL)) != -1)
switch(opt)
{
@ -236,6 +239,9 @@ main(int argc, char *argv[])
case 'k':
return config_check(confpath);
break;
case 's':
xsync = True;
break;
}
/* Text won't be printed correctly otherwise */
@ -258,6 +264,9 @@ main(int argc, char *argv[])
xerrorxlib = XSetErrorHandler(xerror);
XSync(dpy, False);
if(xsync)
XSynchronize(dpy, True);
/* store display */
globalconf.display = dpy;