aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2002-10-15 20:41:08 (GMT)
committerfluxgen <fluxgen>2002-10-15 20:41:08 (GMT)
commit190fb70173e45fbfb3ea2c6195102598e1f4fb34 (patch)
tree9e24298dece1da4c906054000eafec3e8de95a18
parent3206c5aeed4b888661154fdfd20a8c1abaa55dd3 (diff)
downloadfluxbox-190fb70173e45fbfb3ea2c6195102598e1f4fb34.zip
fluxbox-190fb70173e45fbfb3ea2c6195102598e1f4fb34.tar.bz2
fixed wrong counter in init for screen with atomhandler
-rw-r--r--src/fluxbox.cc51
1 files changed, 26 insertions, 25 deletions
diff --git a/src/fluxbox.cc b/src/fluxbox.cc
index a3a1b6e..1393d8d 100644
--- a/src/fluxbox.cc
+++ b/src/fluxbox.cc
@@ -22,7 +22,7 @@
22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23// DEALINGS IN THE SOFTWARE. 23// DEALINGS IN THE SOFTWARE.
24 24
25// $Id: fluxbox.cc,v 1.76 2002/10/11 10:23:54 fluxgen Exp $ 25// $Id: fluxbox.cc,v 1.77 2002/10/15 20:41:08 fluxgen Exp $
26 26
27 27
28#include "fluxbox.hh" 28#include "fluxbox.hh"
@@ -324,7 +324,7 @@ key(0)
324 abort(); 324 abort();
325 } 325 }
326 326
327 //setup signals 327 //setup system signals
328 SignalHandler *sigh = SignalHandler::instance(); 328 SignalHandler *sigh = SignalHandler::instance();
329 329
330 sigh->registerHandler(SIGSEGV, this); 330 sigh->registerHandler(SIGSEGV, this);
@@ -343,8 +343,8 @@ key(0)
343 cursor.lr_angle = XCreateFontCursor(getXDisplay(), XC_lr_angle); 343 cursor.lr_angle = XCreateFontCursor(getXDisplay(), XC_lr_angle);
344 344
345 // setup atom handlers 345 // setup atom handlers
346 m_atomhandler.push_back(new Gnome()); 346 m_atomhandler.push_back(new Gnome()); // for gnome 1 atom support
347// m_atomhandler.push_back(new Ewmh()); 347// m_atomhandler.push_back(new Ewmh()); // for Extended window manager atom support
348 348
349 //singleton pointer 349 //singleton pointer
350 singleton = this; 350 singleton = this;
@@ -353,10 +353,10 @@ key(0)
353 setupConfigFiles(); 353 setupConfigFiles();
354 354
355 if (! XSupportsLocale()) 355 if (! XSupportsLocale())
356 fprintf(stderr, "X server does not support locale\n"); 356 cerr<<"Warning: X server does not support locale"<<endl;
357 357
358 if (XSetLocaleModifiers("") == 0) 358 if (XSetLocaleModifiers("") == 0)
359 fprintf(stderr, "cannot set locale modifiers\n"); 359 cerr<<"Warning: cannot set locale modifiers"<<endl;
360 360
361// Set default values to member variables 361// Set default values to member variables
362 362
@@ -389,6 +389,8 @@ key(0)
389 delete screen; 389 delete screen;
390 continue; 390 continue;
391 } 391 }
392 screenList.push_back(screen);
393
392 // attach screen signals to this 394 // attach screen signals to this
393 screen->currentWorkspaceSig().attach(this); 395 screen->currentWorkspaceSig().attach(this);
394 screen->workspaceCountSig().attach(this); 396 screen->workspaceCountSig().attach(this);
@@ -397,10 +399,10 @@ key(0)
397 399
398 // initiate atomhandler for screen specific stuff 400 // initiate atomhandler for screen specific stuff
399 for (size_t atomh=0; atomh<m_atomhandler.size(); ++atomh) { 401 for (size_t atomh=0; atomh<m_atomhandler.size(); ++atomh) {
400 m_atomhandler[i]->initForScreen(*screen); 402 m_atomhandler[atomh]->initForScreen(*screen);
401 } 403 }
402 404
403 screenList.push_back(screen); 405
404 } 406 }
405 407
406 I18n *i18n = I18n::instance(); 408 I18n *i18n = I18n::instance();
@@ -423,7 +425,7 @@ key(0)
423 timer.fireOnce(True); 425 timer.fireOnce(True);
424 426
425 //create keybindings handler and load keys file 427 //create keybindings handler and load keys file
426 key = new Keys(getXDisplay(), StringUtil::expandFilename(*m_rc_keyfile).c_str()); 428 key = auto_ptr<Keys>(new Keys(getXDisplay(), StringUtil::expandFilename(*m_rc_keyfile).c_str()));
427 429
428 ungrab(); 430 ungrab();
429} 431}
@@ -447,8 +449,6 @@ Fluxbox::~Fluxbox() {
447 delete ts; 449 delete ts;
448 } 450 }
449 451
450 delete key;
451 key = 0;
452} 452}
453 453
454//---------- setupConfigFiles ----------- 454//---------- setupConfigFiles -----------
@@ -486,9 +486,9 @@ void Fluxbox::setupConfigFiles() {
486 createMenu = true; 486 createMenu = true;
487 487
488 } else { 488 } else {
489 #ifdef DEBUG 489#ifdef DEBUG
490 cerr <<__FILE__<<"("<<__LINE__<<"): Creating dir: " << dirname.c_str() << endl; 490 cerr <<__FILE__<<"("<<__LINE__<<"): Creating dir: " << dirname.c_str() << endl;
491 #endif // DEBUG 491#endif // DEBUG
492 492
493 // create directory with perm 700 493 // create directory with perm 700
494 if (mkdir(dirname.c_str(), 0700)) { 494 if (mkdir(dirname.c_str(), 0700)) {
@@ -1334,9 +1334,9 @@ void Fluxbox::handleKeyEvent(XKeyEvent &ke) {
1334 DisplayString(getXDisplay())); 1334 DisplayString(getXDisplay()));
1335 sprintf(displaystring + strlen(displaystring) - 1, "%d", 1335 sprintf(displaystring + strlen(displaystring) - 1, "%d",
1336 screen->getScreenNumber()); 1336 screen->getScreenNumber());
1337 #ifdef DEBUG 1337#ifdef DEBUG
1338 cerr<<__FILE__<<"("<<__LINE__<<"): Executing:"<<key->getExecCommand().c_str()<<endl; 1338 cerr<<__FILE__<<"("<<__LINE__<<"): Executing:"<<key->getExecCommand().c_str()<<endl;
1339 #endif 1339#endif // DEBUG
1340 1340
1341 bexec(key->getExecCommand().c_str(), displaystring); 1341 bexec(key->getExecCommand().c_str(), displaystring);
1342 #else 1342 #else
@@ -1554,6 +1554,7 @@ void Fluxbox::doWindowAction(Keys::KeyAction action, const int param) {
1554 1554
1555} 1555}
1556 1556
1557// handle system signals here
1557void Fluxbox::handleEvent(SignalEvent * const sig) { 1558void Fluxbox::handleEvent(SignalEvent * const sig) {
1558 I18n *i18n = I18n::instance(); 1559 I18n *i18n = I18n::instance();
1559 static int re_enter = 0; 1560 static int re_enter = 0;
@@ -1607,7 +1608,7 @@ void Fluxbox::handleEvent(SignalEvent * const sig) {
1607 1608
1608 1609
1609void Fluxbox::update(FbTk::Subject *changedsub) { 1610void Fluxbox::update(FbTk::Subject *changedsub) {
1610 1611//TODO: fix signaling, this does not look good
1611 if (typeid(*changedsub) == typeid(FluxboxWindow)) { 1612 if (typeid(*changedsub) == typeid(FluxboxWindow)) {
1612 FluxboxWindow::WinSubject *winsub = dynamic_cast<FluxboxWindow::WinSubject *>(changedsub); 1613 FluxboxWindow::WinSubject *winsub = dynamic_cast<FluxboxWindow::WinSubject *>(changedsub);
1613 FluxboxWindow &win = winsub->win(); 1614 FluxboxWindow &win = winsub->win();
@@ -1768,7 +1769,7 @@ void Fluxbox::saveTabSearch(Window window, Tab *data) {
1768 tabSearch[window] = data; 1769 tabSearch[window] = data;
1769} 1770}
1770 1771
1771#ifdef SLIT 1772#ifdef SLIT
1772void Fluxbox::saveSlitSearch(Window window, Slit *data) { 1773void Fluxbox::saveSlitSearch(Window window, Slit *data) {
1773 slitSearch[window] = data; 1774 slitSearch[window] = data;
1774} 1775}
@@ -1818,7 +1819,7 @@ void Fluxbox::restart(const char *prog) {
1818} 1819}
1819 1820
1820 1821
1821void Fluxbox::shutdown(void) { 1822void Fluxbox::shutdown() {
1822 BaseDisplay::shutdown(); 1823 BaseDisplay::shutdown();
1823 1824
1824 XSetInputFocus(getXDisplay(), PointerRoot, None, CurrentTime); 1825 XSetInputFocus(getXDisplay(), PointerRoot, None, CurrentTime);
@@ -1838,7 +1839,7 @@ void Fluxbox::shutdown(void) {
1838//------ save_rc -------- 1839//------ save_rc --------
1839//saves resources 1840//saves resources
1840//---------------------- 1841//----------------------
1841void Fluxbox::save_rc(void) { 1842void Fluxbox::save_rc() {
1842 1843
1843 XrmDatabase new_blackboxrc = 0; 1844 XrmDatabase new_blackboxrc = 0;
1844 1845
@@ -2024,7 +2025,7 @@ void Fluxbox::getDefaultDataFilename(char *name, string &filename) {
2024 filename = string(getenv("HOME")+string("/.")+RC_PATH+string("/")+name); 2025 filename = string(getenv("HOME")+string("/.")+RC_PATH+string("/")+name);
2025} 2026}
2026 2027
2027void Fluxbox::load_rc(void) { 2028void Fluxbox::load_rc() {
2028 XrmDatabaseHelper database; 2029 XrmDatabaseHelper database;
2029 2030
2030 //get resource filename 2031 //get resource filename
@@ -2432,7 +2433,7 @@ void Fluxbox::real_reconfigure() {
2432//------------- reconfigureTabs ---------- 2433//------------- reconfigureTabs ----------
2433// Reconfigure all tabs size and increase steps 2434// Reconfigure all tabs size and increase steps
2434// --------------------------------------- 2435// ---------------------------------------
2435void Fluxbox::reconfigureTabs(void) { 2436void Fluxbox::reconfigureTabs() {
2436 //tab reconfiguring 2437 //tab reconfiguring
2437 TabList::iterator it = tabSearch.begin(); 2438 TabList::iterator it = tabSearch.begin();
2438 TabList::iterator it_end = tabSearch.end(); 2439 TabList::iterator it_end = tabSearch.end();
@@ -2453,7 +2454,7 @@ void Fluxbox::reconfigureTabs(void) {
2453 } 2454 }
2454} 2455}
2455 2456
2456void Fluxbox::checkMenu(void) { 2457void Fluxbox::checkMenu() {
2457 Bool reread = False; 2458 Bool reread = False;
2458 std::list<MenuTimestamp *>::iterator it = menuTimestamps.begin(); 2459 std::list<MenuTimestamp *>::iterator it = menuTimestamps.begin();
2459 std::list<MenuTimestamp *>::iterator it_end = menuTimestamps.end(); 2460 std::list<MenuTimestamp *>::iterator it_end = menuTimestamps.end();
@@ -2471,14 +2472,14 @@ void Fluxbox::checkMenu(void) {
2471} 2472}
2472 2473
2473 2474
2474void Fluxbox::rereadMenu(void) { 2475void Fluxbox::rereadMenu() {
2475 reread_menu_wait = True; 2476 reread_menu_wait = True;
2476 2477
2477 if (! timer.isTiming()) timer.start(); 2478 if (! timer.isTiming()) timer.start();
2478} 2479}
2479 2480
2480 2481
2481void Fluxbox::real_rereadMenu(void) { 2482void Fluxbox::real_rereadMenu() {
2482 std::list<MenuTimestamp *>::iterator it = menuTimestamps.begin(); 2483 std::list<MenuTimestamp *>::iterator it = menuTimestamps.begin();
2483 std::list<MenuTimestamp *>::iterator it_end = menuTimestamps.end(); 2484 std::list<MenuTimestamp *>::iterator it_end = menuTimestamps.end();
2484 for (; it != it_end; ++it) { 2485 for (; it != it_end; ++it) {
@@ -2524,7 +2525,7 @@ void Fluxbox::saveMenuFilename(const char *filename) {
2524} 2525}
2525 2526
2526 2527
2527void Fluxbox::timeout(void) { 2528void Fluxbox::timeout() {
2528 if (reconfigure_wait) 2529 if (reconfigure_wait)
2529 real_reconfigure(); 2530 real_reconfigure();
2530 2531