all repos — fluxbox @ 3d7b466e7aff343dee152d4937d824d2860aac6b

custom fork of the fluxbox windowmanager

delay repositioning of labels

The iconbuttons delay their update to cover multiple changes, so if the
labels are repositioned early, they'll operate on dated titles

BUG: 1155

On the run, centralize the delay value in IconButton::updateLaziness()
Thomas Lübking thomas.luebking@gmail.com
commit

3d7b466e7aff343dee152d4937d824d2860aac6b

parent

e480255a7974cdc4b5cf0016169ed8347b2f431a

5 files changed, 15 insertions(+), 2 deletions(-)

jump to
M src/IconButton.ccsrc/IconButton.cc

@@ -52,7 +52,7 @@ m_has_tooltip(false),

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<FbTk::Command<void> > ets(new FbTk::SimpleCommand<IconButton>(*this, &IconButton::clientTitleChanged)); m_title_update_timer.setCommand(ets);
M src/IconButton.hhsrc/IconButton.hh

@@ -70,6 +70,8 @@ void showTooltip();

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:
M src/IconbarTool.ccsrc/IconbarTool.cc

@@ -288,7 +288,7 @@ FbTk::MemFun(*this, &IconbarTool::themeReconfigured));

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<FbTk::Command<void> > ers(new FbTk::SimpleCommand<IconbarTool>(*this, &IconbarTool::emitResizeSig)); m_resizeSig_timer.setCommand(ers);
M src/Window.ccsrc/Window.cc

@@ -449,6 +449,11 @@ FbTk::RefCount<ActivateTabCmd> activate_tab_cmd(new ActivateTabCmd());

m_tabActivationTimer.setCommand(activate_tab_cmd); m_tabActivationTimer.fireOnce(true); + m_reposLabels_timer.setTimeout(IconButton::updateLaziness()); + m_reposLabels_timer.fireOnce(true); + FbTk::RefCount<FbTk::Command<void> > elrs(new FbTk::SimpleCommand<FluxboxWindow>(*this, &FluxboxWindow::emitLabelReposSig)); + m_reposLabels_timer.setCommand(elrs); + /**************************************************/ /* Read state above here, apply state below here. */ /**************************************************/

@@ -2851,6 +2856,10 @@

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(); }
M src/Window.hhsrc/Window.hh

@@ -576,6 +576,8 @@ ClientList m_clientlist;

WinClient *m_client; ///< current client typedef std::map<WinClient *, IconButton *> Client2ButtonMap; Client2ButtonMap m_labelbuttons; + FbTk::Timer m_reposLabels_timer; + void emitLabelReposSig(); bool m_has_tooltip; SizeHints m_size_hint;