From b78255fa1a8040b9948f3749764f5dd03b5f54c8 Mon Sep 17 00:00:00 2001 From: fluxgen Date: Wed, 14 Jul 2004 23:39:29 +0000 Subject: fixed toolbar draw bug at startup --- src/Toolbar.cc | 6 +++--- src/fluxbox.cc | 24 ++++++++++++++++++++---- 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/src/Toolbar.cc b/src/Toolbar.cc index 2a39ec0..caa3eca 100644 --- a/src/Toolbar.cc +++ b/src/Toolbar.cc @@ -22,7 +22,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Toolbar.cc,v 1.146 2004/06/21 15:23:42 rathnor Exp $ +// $Id: Toolbar.cc,v 1.147 2004/07/14 23:39:29 fluxgen Exp $ #include "Toolbar.hh" @@ -260,7 +260,7 @@ Toolbar::Toolbar(BScreen &scrn, FbTk::XLayer &layer, size_t width): // show all windows frame.window.showSubwindows(); - frame.window.show(); + // frame.window.show(); scrn.resourceManager().unlock(); // setup to listen to child events @@ -351,7 +351,7 @@ void Toolbar::lower() { } void Toolbar::reconfigure() { - updateVisibleState(); + // updateVisibleState(); if (!doAutoHide() && isHidden()) toggleHidden(); diff --git a/src/fluxbox.cc b/src/fluxbox.cc index 3a93962..1adc314 100644 --- a/src/fluxbox.cc +++ b/src/fluxbox.cc @@ -22,7 +22,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: fluxbox.cc,v 1.245 2004/06/21 15:23:42 rathnor Exp $ +// $Id: fluxbox.cc,v 1.246 2004/07/14 23:38:53 fluxgen Exp $ #include "fluxbox.hh" @@ -592,6 +592,7 @@ Fluxbox::Fluxbox(int argc, char **argv, const char *dpy_name, const char *rcfile screen->slit()->show(); #endif // SLIT + } // end init screens XAllowEvents(disp, ReplayPointer, CurrentTime); @@ -627,6 +628,15 @@ Fluxbox::Fluxbox(int argc, char **argv, const char *dpy_name, const char *rcfile // FbTk::ThemeManager::instance().listItems(); // // m_resourcemanager.dump(); + +#ifdef USE_TOOLBAR + // finally, show toolbar + Toolbars::iterator toolbar_it = m_toolbars.begin(); + Toolbars::iterator toolbar_it_end = m_toolbars.end(); + for (; toolbar_it != toolbar_it_end; ++toolbar_it) + (*toolbar_it)->updateVisibleState(); +#endif // USE_TOOLBAR + } @@ -692,6 +702,7 @@ void Fluxbox::grab() { void Fluxbox::ungrab() { if (! --m_server_grabs) XUngrabServer(display()); + if (m_server_grabs < 0) m_server_grabs = 0; } @@ -860,6 +871,7 @@ void Fluxbox::handleEvent(XEvent * const e) { #ifdef DEBUG cerr<<"MapRequest for 0x"<xmaprequest.window<xmaprequest.window); @@ -900,9 +912,9 @@ void Fluxbox::handleEvent(XEvent * const e) { win->mapRequestEvent(e->xmaprequest); } break; - case MapNotify: { + case MapNotify: // handled directly in FluxboxWindow::handleEvent - } break; + break; case UnmapNotify: handleUnmapNotify(e->xunmap); break; @@ -951,6 +963,7 @@ void Fluxbox::handleEvent(XEvent * const e) { } } break; case EnterNotify: { + m_last_time = e->xcrossing.time; BScreen *screen = 0; @@ -965,6 +978,7 @@ void Fluxbox::handleEvent(XEvent * const e) { } break; case LeaveNotify: + m_last_time = e->xcrossing.time; break; case Expose: @@ -995,7 +1009,6 @@ void Fluxbox::handleEvent(XEvent * const e) { } break; case FocusOut:{ - // and here we ignore some window losing the special grab focus if (e->xfocus.mode == NotifyGrab || e->xfocus.detail == NotifyPointer || @@ -1018,6 +1031,7 @@ void Fluxbox::handleEvent(XEvent * const e) { handleClientMessage(e->xclient); break; default: { + #ifdef HAVE_RANDR if (e->type == m_randr_event_type) { // update root window size in screen @@ -1966,6 +1980,8 @@ void Fluxbox::setFocusedWindow(WinClient *client) { } #ifdef DEBUG cerr<<"Setting Focused window = "<fbwindow() != 0) + cerr<<"title: "<fbwindow()->title()<