diff --git a/src/IconButton.cc b/src/IconButton.cc index a4cd8af7..1290c2aa 100644 --- a/src/IconButton.cc +++ b/src/IconButton.cc @@ -52,7 +52,7 @@ IconButton::IconButton(const FbTk::FbWindow &parent, m_theme(win, focused_theme, unfocused_theme), m_pm(win.screen().imageControl()) { - m_title_update_timer.setTimeout(100 * FbTk::FbTime::IN_MILLISECONDS); + m_title_update_timer.setTimeout(updateLaziness()); m_title_update_timer.fireOnce(true); FbTk::RefCount > ets(new FbTk::SimpleCommand(*this, &IconButton::clientTitleChanged)); m_title_update_timer.setCommand(ets); diff --git a/src/IconButton.hh b/src/IconButton.hh index 4bb57e72..638d1950 100644 --- a/src/IconButton.hh +++ b/src/IconButton.hh @@ -70,6 +70,8 @@ public: const FbTk::Signal<> &titleChanged() { return m_title_changed; } + static unsigned int updateLaziness() { return 100 * FbTk::FbTime::IN_MILLISECONDS; } + protected: void drawText(int x, int y, FbTk::FbDrawable *drawable_override); private: diff --git a/src/IconbarTool.cc b/src/IconbarTool.cc index 6e561dc8..8f8f128c 100644 --- a/src/IconbarTool.cc +++ b/src/IconbarTool.cc @@ -288,7 +288,7 @@ IconbarTool::IconbarTool(const FbTk::FbWindow &parent, IconbarTheme &theme, m_tracker.join(screen.reconfigureSig(), FbTk::MemFunIgnoreArgs(*this, &IconbarTool::updateIconifiedPattern)); - m_resizeSig_timer.setTimeout(100 * FbTk::FbTime::IN_MILLISECONDS); + m_resizeSig_timer.setTimeout(IconButton::updateLaziness()); m_resizeSig_timer.fireOnce(true); FbTk::RefCount > ers(new FbTk::SimpleCommand(*this, &IconbarTool::emitResizeSig)); m_resizeSig_timer.setCommand(ers); diff --git a/src/Window.cc b/src/Window.cc index 664c0a5b..23c97897 100644 --- a/src/Window.cc +++ b/src/Window.cc @@ -449,6 +449,11 @@ void FluxboxWindow::init() { m_tabActivationTimer.setCommand(activate_tab_cmd); m_tabActivationTimer.fireOnce(true); + m_reposLabels_timer.setTimeout(IconButton::updateLaziness()); + m_reposLabels_timer.fireOnce(true); + FbTk::RefCount > elrs(new FbTk::SimpleCommand(*this, &FluxboxWindow::emitLabelReposSig)); + m_reposLabels_timer.setCommand(elrs); + /**************************************************/ /* Read state above here, apply state below here. */ /**************************************************/ @@ -2851,6 +2856,10 @@ void FluxboxWindow::setTitle(const std::string& title, Focusable &client) { frame().setFocusTitle(title); // relay title to others that display the focus title titleSig().emit(title, *this); + m_reposLabels_timer.start(); +} + +void FluxboxWindow::emitLabelReposSig() { frame().tabcontainer().repositionItems(); } diff --git a/src/Window.hh b/src/Window.hh index 0cfe73a5..407d51bd 100644 --- a/src/Window.hh +++ b/src/Window.hh @@ -576,6 +576,8 @@ private: WinClient *m_client; ///< current client typedef std::map Client2ButtonMap; Client2ButtonMap m_labelbuttons; + FbTk::Timer m_reposLabels_timer; + void emitLabelReposSig(); bool m_has_tooltip; SizeHints m_size_hint;