aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMark Tiefenbruck <mark@fluxbox.org>2008-08-22 13:12:01 (GMT)
committerMark Tiefenbruck <mark@fluxbox.org>2008-08-22 13:12:01 (GMT)
commitf1ff5ff3b2947ca31f0718e37bb0b2668303247f (patch)
tree13c3179dd6bc492db13e5e4c76b148c417d0c8c9 /src
parent5a877163c77e4f5d13e5f01a01b254fefddf4235 (diff)
downloadfluxbox-f1ff5ff3b2947ca31f0718e37bb0b2668303247f.zip
fluxbox-f1ff5ff3b2947ca31f0718e37bb0b2668303247f.tar.bz2
add -sync command line option for debugging X issues
Diffstat (limited to 'src')
-rw-r--r--src/fluxbox.cc6
-rw-r--r--src/fluxbox.hh2
-rw-r--r--src/main.cc7
3 files changed, 11 insertions, 4 deletions
diff --git a/src/fluxbox.cc b/src/fluxbox.cc
index d9deea7..27a0b68 100644
--- a/src/fluxbox.cc
+++ b/src/fluxbox.cc
@@ -179,7 +179,8 @@ int handleXErrors(Display *d, XErrorEvent *e) {
179//static singleton var 179//static singleton var
180Fluxbox *Fluxbox::s_singleton=0; 180Fluxbox *Fluxbox::s_singleton=0;
181 181
182Fluxbox::Fluxbox(int argc, char **argv, const char *dpy_name, const char *rcfilename) 182Fluxbox::Fluxbox(int argc, char **argv, const char *dpy_name,
183 const char *rcfilename, bool xsync)
183 : FbTk::App(dpy_name), 184 : FbTk::App(dpy_name),
184 m_fbatoms(new FbAtoms()), 185 m_fbatoms(new FbAtoms()),
185 m_resourcemanager(rcfilename, true), 186 m_resourcemanager(rcfilename, true),
@@ -263,7 +264,8 @@ Fluxbox::Fluxbox(int argc, char **argv, const char *dpy_name, const char *rcfile
263 m_reconfig_timer.setCommand(reconfig_cmd); 264 m_reconfig_timer.setCommand(reconfig_cmd);
264 m_reconfig_timer.fireOnce(true); 265 m_reconfig_timer.fireOnce(true);
265 266
266 // XSynchronize(disp, True); 267 if (xsync)
268 XSynchronize(disp, True);
267 269
268 s_singleton = this; 270 s_singleton = this;
269 m_have_shape = false; 271 m_have_shape = false;
diff --git a/src/fluxbox.hh b/src/fluxbox.hh
index e761eda..a6c0b2f 100644
--- a/src/fluxbox.hh
+++ b/src/fluxbox.hh
@@ -77,7 +77,7 @@ class Fluxbox : public FbTk::App,
77 public FbTk::Observer { 77 public FbTk::Observer {
78public: 78public:
79 Fluxbox(int argc, char **argv, const char * dpy_name= 0, 79 Fluxbox(int argc, char **argv, const char * dpy_name= 0,
80 const char *rcfilename = 0); 80 const char *rcfilename = 0, bool xsync = false);
81 virtual ~Fluxbox(); 81 virtual ~Fluxbox();
82 82
83 static Fluxbox *instance() { return s_singleton; } 83 static Fluxbox *instance() { return s_singleton; }
diff --git a/src/main.cc b/src/main.cc
index fb47bc7..d69ce2d 100644
--- a/src/main.cc
+++ b/src/main.cc
@@ -183,6 +183,7 @@ int main(int argc, char **argv) {
183 string session_display(""); 183 string session_display("");
184 string rc_file; 184 string rc_file;
185 string log_filename; 185 string log_filename;
186 bool xsync = false;
186 187
187 FbTk::NLSInit("fluxbox.cat"); 188 FbTk::NLSInit("fluxbox.cat");
188 _FB_USES_NLS; 189 _FB_USES_NLS;
@@ -229,6 +230,8 @@ int main(int argc, char **argv) {
229 exit(EXIT_FAILURE); 230 exit(EXIT_FAILURE);
230 } 231 }
231 log_filename = argv[i]; 232 log_filename = argv[i];
233 } else if (arg == "-sync") {
234 xsync = true;
232 } else if (arg == "-help" || arg == "-h") { 235 } else if (arg == "-help" || arg == "-h") {
233 // print program usage and command line options 236 // print program usage and command line options
234 printf(_FB_CONSOLETEXT(main, Usage, 237 printf(_FB_CONSOLETEXT(main, Usage,
@@ -240,6 +243,7 @@ int main(int argc, char **argv) {
240 "-version\t\t\tdisplay version and exit.\n" 243 "-version\t\t\tdisplay version and exit.\n"
241 "-info\t\t\t\tdisplay some useful information.\n" 244 "-info\t\t\t\tdisplay some useful information.\n"
242 "-list-commands\t\t\tlist all valid key commands.\n" 245 "-list-commands\t\t\tlist all valid key commands.\n"
246 "-sync\t\t\t\tsynchronize with X server for debugging.\n"
243 "-log <filename>\t\t\tlog output to file.\n" 247 "-log <filename>\t\t\tlog output to file.\n"
244 "-help\t\t\t\tdisplay this help text and exit.\n\n", 248 "-help\t\t\t\tdisplay this help text and exit.\n\n",
245 249
@@ -286,7 +290,8 @@ int main(int argc, char **argv) {
286 290
287 try { 291 try {
288 292
289 fluxbox.reset(new Fluxbox(argc, argv, session_display.c_str(), rc_file.c_str())); 293 fluxbox.reset(new Fluxbox(argc, argv, session_display.c_str(),
294 rc_file.c_str(), xsync));
290 fluxbox->eventLoop(); 295 fluxbox->eventLoop();
291 296
292 exitcode = EXIT_SUCCESS; 297 exitcode = EXIT_SUCCESS;