add -sync command line option for debugging X issues

This commit is contained in:
Mark Tiefenbruck 2008-08-22 06:12:01 -07:00
parent 5a877163c7
commit f1ff5ff3b2
13 changed files with 909 additions and 1386 deletions

File diff suppressed because it is too large Load diff

View file

@ -14,6 +14,7 @@ SYNOPSIS
[-display display]
[-screen scr,scr|all]
[-verbose]
[-sync]
'fluxbox' [-v | -version] |
[-h | -help] |
@ -67,6 +68,8 @@ OPTIONS
Run on specified screens only or all (by default).
-verbose::
Print more information in process.
-sync::
Synchronize with the X server for debugging.
STARTING FLUXBOX
----------------

View file

@ -1,11 +1,11 @@
.\" Title: fluxbox
.\" Author:
.\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
.\" Date: 08/20/2008
.\" Date: 08/22/2008
.\" Manual:
.\" Source:
.\"
.TH "FLUXBOX" "1" "08/20/2008" "" ""
.TH "FLUXBOX" "1" "08/22/2008" "" ""
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
@ -13,7 +13,7 @@
.SH "NAME"
fluxbox - A lightweight window manager for the X Windowing System
.SH "SYNOPSIS"
\fIfluxbox\fR [\-rc rcfile] [\-log logfile] [\-display display] [\-screen scr,scr|all] [\-verbose]
\fIfluxbox\fR [\-rc rcfile] [\-log logfile] [\-display display] [\-screen scr,scr|all] [\-verbose] [\-sync]
.sp
\fIfluxbox\fR [\-v | \-version] | [\-h | \-help] | [\-i | \-info] | [\-list\-commands]
.sp
@ -67,6 +67,11 @@ Run on specified screens only or all (by default)\.
.RS 4
Print more information in process\.
.RE
.PP
\-sync
.RS 4
Synchronize with the X server for debugging\.
.RE
.SH "STARTING FLUXBOX"
fluxbox(1) comes with a program called startfluxbox(8) usually located wherever you installed fluxbox\. This script provides you with many options and variables that can be set when starting fluxbox\. To actually call fluxbox and begin using it, you should place "exec startfluxbox" in your /\.xinitrc or /\.xsession (depending on your distribution and/or display manager) as the last executed command\. This is assuming that the location of fluxbox(1) and startfluxbox(8) are in your shell\'s $PATH\. Also note that you may need to create the /\.xinitrc file or your setup may use /\.xsession instead, depending on your X setup\. For more information on your shell, please visit your shell\'s manual page\.
.sp

View file

@ -263,6 +263,7 @@ Website: http://www.fluxbox.org/\n\n\
-version\t\t\tdisplay version and exit.\n\
-info\t\t\t\tdisplay some useful information.\n\
-list-commands\t\t\tlist all valid key commands.\n\
-sync\t\t\t\tsynchronize with X server for debugging.\n\
-log <filename>\t\t\tlog output to file.\n\
-help\t\t\t\tdisplay this help text and exit.\n\n
14 warning: couldn't set environment variable 'DISPLAY'

View file

@ -263,6 +263,7 @@ Website: http://www.fluxbox.org/\n\n\
-version\t\t\tdisplay version and exit.\n\
-info\t\t\t\tdisplay some useful information.\n\
-list-commands\t\t\tlist all valid key commands.\n\
-sync\t\t\t\tsynchronize with X server for debugging.\n\
-log <filename>\t\t\tlog output to file.\n\
-help\t\t\t\tdisplay this help text and exit.\n\n
14 warning: couldn't set environment variable 'DISPLAY'

View file

@ -263,6 +263,7 @@ Website: http://www.fluxbox.org/\n\n\
-version\t\t\tdisplay version and exit.\n\
-info\t\t\t\tdisplay some useful information.\n\
-list-commands\t\t\tlist all valid key commands.\n\
-sync\t\t\t\tsynchronize with X server for debugging.\n\
-log <filename>\t\t\tlog output to file.\n\
-help\t\t\t\tdisplay this help text and exit.\n\n
14 warning: couldn't set environment variable 'DISPLAY'

View file

@ -263,6 +263,7 @@ Website: http://www.fluxbox.org/\n\n\
-version\t\t\tdisplay version and exit.\n\
-info\t\t\t\tdisplay some useful information.\n\
-list-commands\t\t\tlist all valid key commands.\n\
-sync\t\t\t\tsynchronize with X server for debugging.\n\
-log <filename>\t\t\tlog output to file.\n\
-help\t\t\t\tdisplay this help text and exit.\n\n
14 warning: couldn't set environment variable 'DISPLAY'

View file

@ -263,6 +263,7 @@ Website: http://www.fluxbox.org/\n\n\
-version\t\t\tdisplay version and exit.\n\
-info\t\t\t\tdisplay some useful information.\n\
-list-commands\t\t\tlist all valid key commands.\n\
-sync\t\t\t\tsynchronize with X server for debugging.\n\
-log <filename>\t\t\tlog output to file.\n\
-help\t\t\t\tdisplay this help text and exit.\n\n
14 warning: couldn't set environment variable 'DISPLAY'

View file

@ -263,6 +263,7 @@ Website: http://www.fluxbox.org/\n\n\
-version\t\t\tdisplay version and exit.\n\
-info\t\t\t\tdisplay some useful information.\n\
-list-commands\t\t\tlist all valid key commands.\n\
-sync\t\t\t\tsynchronize with X server for debugging.\n\
-log <filename>\t\t\tlog output to file.\n\
-help\t\t\t\tdisplay this help text and exit.\n\n
14 warning: couldn't set environment variable 'DISPLAY'

View file

@ -263,6 +263,7 @@ Website: http://www.fluxbox.org/\n\n\
-version\t\t\tdisplay version and exit.\n\
-info\t\t\t\tdisplay some useful information.\n\
-list-commands\t\t\tlist all valid key commands.\n\
-sync\t\t\t\tsynchronize with X server for debugging.\n\
-log <filename>\t\t\tlog output to file.\n\
-help\t\t\t\tdisplay this help text and exit.\n\n
14 warning: couldn't set environment variable 'DISPLAY'

View file

@ -179,7 +179,8 @@ int handleXErrors(Display *d, XErrorEvent *e) {
//static singleton var
Fluxbox *Fluxbox::s_singleton=0;
Fluxbox::Fluxbox(int argc, char **argv, const char *dpy_name, const char *rcfilename)
Fluxbox::Fluxbox(int argc, char **argv, const char *dpy_name,
const char *rcfilename, bool xsync)
: FbTk::App(dpy_name),
m_fbatoms(new FbAtoms()),
m_resourcemanager(rcfilename, true),
@ -263,7 +264,8 @@ Fluxbox::Fluxbox(int argc, char **argv, const char *dpy_name, const char *rcfile
m_reconfig_timer.setCommand(reconfig_cmd);
m_reconfig_timer.fireOnce(true);
// XSynchronize(disp, True);
if (xsync)
XSynchronize(disp, True);
s_singleton = this;
m_have_shape = false;

View file

@ -77,7 +77,7 @@ class Fluxbox : public FbTk::App,
public FbTk::Observer {
public:
Fluxbox(int argc, char **argv, const char * dpy_name= 0,
const char *rcfilename = 0);
const char *rcfilename = 0, bool xsync = false);
virtual ~Fluxbox();
static Fluxbox *instance() { return s_singleton; }

View file

@ -183,6 +183,7 @@ int main(int argc, char **argv) {
string session_display("");
string rc_file;
string log_filename;
bool xsync = false;
FbTk::NLSInit("fluxbox.cat");
_FB_USES_NLS;
@ -229,6 +230,8 @@ int main(int argc, char **argv) {
exit(EXIT_FAILURE);
}
log_filename = argv[i];
} else if (arg == "-sync") {
xsync = true;
} else if (arg == "-help" || arg == "-h") {
// print program usage and command line options
printf(_FB_CONSOLETEXT(main, Usage,
@ -240,6 +243,7 @@ int main(int argc, char **argv) {
"-version\t\t\tdisplay version and exit.\n"
"-info\t\t\t\tdisplay some useful information.\n"
"-list-commands\t\t\tlist all valid key commands.\n"
"-sync\t\t\t\tsynchronize with X server for debugging.\n"
"-log <filename>\t\t\tlog output to file.\n"
"-help\t\t\t\tdisplay this help text and exit.\n\n",
@ -286,7 +290,8 @@ int main(int argc, char **argv) {
try {
fluxbox.reset(new Fluxbox(argc, argv, session_display.c_str(), rc_file.c_str()));
fluxbox.reset(new Fluxbox(argc, argv, session_display.c_str(),
rc_file.c_str(), xsync));
fluxbox->eventLoop();
exitcode = EXIT_SUCCESS;