aboutsummaryrefslogtreecommitdiff
path: root/src/WinClient.cc
diff options
context:
space:
mode:
authorThomas Lübking <thomas.luebking@gmail.com>2016-08-03 21:55:26 (GMT)
committerThomas Lübking <thomas.luebking@gmail.com>2016-08-06 15:09:29 (GMT)
commit59d9b0703ba8efb24893528f2eb9c84aaa8f5f83 (patch)
tree30fd4de07fa1fdaaac4420c218e7fae3ff3a0382 /src/WinClient.cc
parenta8b0b3632b4ed6e6fb5f8aa26a6c0ef151a30144 (diff)
downloadfluxbox-59d9b0703ba8efb24893528f2eb9c84aaa8f5f83.zip
fluxbox-59d9b0703ba8efb24893528f2eb9c84aaa8f5f83.tar.bz2
delay title updates
Notably shells will cause brief interim titles when calling short-lived commands (try "ls"...) This covers such by waiting 100ms after every title update before reacting (the title will have returned in the mentioned cases, the UI remains steady)
Diffstat (limited to 'src/WinClient.cc')
-rw-r--r--src/WinClient.cc11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/WinClient.cc b/src/WinClient.cc
index b73f27c..22ee766 100644
--- a/src/WinClient.cc
+++ b/src/WinClient.cc
@@ -119,6 +119,11 @@ WinClient::WinClient(Window win, BScreen &screen, FluxboxWindow *fbwin):
119 s_transient_wait.erase(win); 119 s_transient_wait.erase(win);
120 } 120 }
121 121
122 m_title_update_timer.setTimeout(100 * FbTk::FbTime::IN_MILLISECONDS);
123 m_title_update_timer.fireOnce(true);
124 FbTk::RefCount<FbTk::Command<void> > ets(new FbTk::SimpleCommand<WinClient>(*this, &WinClient::emitTitleSig));
125 m_title_update_timer.setCommand(ets);
126
122 // also check if this window is a transient 127 // also check if this window is a transient
123 // this needs to be done before creating an fbwindow, so this doesn't get 128 // this needs to be done before creating an fbwindow, so this doesn't get
124 // tabbed using the apps file 129 // tabbed using the apps file
@@ -314,13 +319,17 @@ void WinClient::updateTitle() {
314 return; 319 return;
315 320
316 m_title.setLogical(FbTk::FbString(Xutil::getWMName(window()), 0, 512)); 321 m_title.setLogical(FbTk::FbString(Xutil::getWMName(window()), 0, 512));
322 m_title_update_timer.start();
323}
324
325void WinClient::emitTitleSig() {
317 titleSig().emit(m_title.logical(), *this); 326 titleSig().emit(m_title.logical(), *this);
318} 327}
319 328
320void WinClient::setTitle(const FbTk::FbString &title) { 329void WinClient::setTitle(const FbTk::FbString &title) {
321 m_title.setLogical(title); 330 m_title.setLogical(title);
322 m_title_override = true; 331 m_title_override = true;
323 titleSig().emit(m_title.logical(), *this); 332 m_title_update_timer.start();
324} 333}
325 334
326void WinClient::setIcon(const FbTk::PixmapWithMask& pm) { 335void WinClient::setIcon(const FbTk::PixmapWithMask& pm) {