aboutsummaryrefslogtreecommitdiff
path: root/src/Window.cc
diff options
context:
space:
mode:
authorHenrik Kinnunen <fluxgen@fluxbox.org>2010-03-26 17:15:45 (GMT)
committerHenrik Kinnunen <fluxgen@fluxbox.org>2010-03-26 17:15:45 (GMT)
commitdd8fcc8b7b4c2bccf90edf9b0acfa52e21f5d1ce (patch)
tree9847618adbc8b6c156e8c3ad41bb2d55d74c1916 /src/Window.cc
parent9ad388c5bf160c8a6c90d76065286540274685fd (diff)
downloadfluxbox-dd8fcc8b7b4c2bccf90edf9b0acfa52e21f5d1ce.zip
fluxbox-dd8fcc8b7b4c2bccf90edf9b0acfa52e21f5d1ce.tar.bz2
Changed title signal in Focusable to new signal system
Diffstat (limited to 'src/Window.cc')
-rw-r--r--src/Window.cc34
1 files changed, 19 insertions, 15 deletions
diff --git a/src/Window.cc b/src/Window.cc
index 34b5d0c..586dc7b 100644
--- a/src/Window.cc
+++ b/src/Window.cc
@@ -988,7 +988,7 @@ bool FluxboxWindow::setCurrentClient(WinClient &client, bool setinput) {
988 button<<endl; 988 button<<endl;
989 989
990 if (old != &client) { 990 if (old != &client) {
991 titleSig().notify(); 991 titleSig().emit(title(), *this);
992 frame().setFocusTitle(title()); 992 frame().setFocusTitle(title());
993 frame().setShapingClient(&client, false); 993 frame().setShapingClient(&client, false);
994 } 994 }
@@ -2103,7 +2103,7 @@ void FluxboxWindow::propertyNotifyEvent(WinClient &client, Atom atom) {
2103 2103
2104 case XA_WM_HINTS: 2104 case XA_WM_HINTS:
2105 client.updateWMHints(); 2105 client.updateWMHints();
2106 titleSig().notify(); 2106 titleSig().emit(title(), *this);
2107 // nothing uses this yet 2107 // nothing uses this yet
2108 // hintSig().notify(); // notify listeners 2108 // hintSig().notify(); // notify listeners
2109 break; 2109 break;
@@ -2707,18 +2707,19 @@ void FluxboxWindow::leaveNotifyEvent(XCrossingEvent &ev) {
2707 //installColormap(false); 2707 //installColormap(false);
2708} 2708}
2709 2709
2710void FluxboxWindow::update(FbTk::Subject *subj) { 2710void FluxboxWindow::setTitle(const std::string& title, Focusable &client) {
2711 if (subj && typeid(*subj) == typeid(Focusable::FocusSubject)) { 2711 // only update focus title for current client
2712 Focusable::FocusSubject &fsubj = 2712 if (&client != m_client) {
2713 static_cast<Focusable::FocusSubject &>(*subj); 2713 return;
2714 Focusable &win = fsubj.win(); 2714 }
2715
2716 if (&fsubj == &win.titleSig() && &win == m_client) {
2717 frame().setFocusTitle(win.title());
2718 titleSig().notify();
2719 }
2720 2715
2721 } else if (subj == &m_theme.reconfigSig()) { 2716 frame().setFocusTitle(title);
2717 // relay title to others that display the focus title
2718 titleSig().emit(title, *this);
2719}
2720
2721void FluxboxWindow::update(FbTk::Subject *subj) {
2722 if (subj == &m_theme.reconfigSig()) {
2722 frame().applyDecorations(); 2723 frame().applyDecorations();
2723 sendConfigureNotify(); 2724 sendConfigureNotify();
2724 } else if (m_initialized && subj == &m_frame.frameExtentSig()) { 2725 } else if (m_initialized && subj == &m_frame.frameExtentSig()) {
@@ -3637,7 +3638,9 @@ void FluxboxWindow::updateButtons() {
3637 dir[i], 3638 dir[i],
3638 frame().titlebar(), 3639 frame().titlebar(),
3639 0, 0, 10, 10); 3640 0, 0, 10, 10);
3640 titleSig().attach(winbtn); 3641 winbtn->join(titleSig(),
3642 FbTk::MemFunIgnoreArgs(*winbtn, &WinButton::updateAll));
3643
3641 winbtn->setOnClick(show_menu_cmd); 3644 winbtn->setOnClick(show_menu_cmd);
3642 break; 3645 break;
3643 } 3646 }
@@ -3709,7 +3712,8 @@ void FluxboxWindow::associateClient(WinClient &client) {
3709 evm.add(*this, btn->window()); // we take care of button events for this 3712 evm.add(*this, btn->window()); // we take care of button events for this
3710 evm.add(*this, client.window()); 3713 evm.add(*this, client.window());
3711 client.setFluxboxWindow(this); 3714 client.setFluxboxWindow(this);
3712 client.titleSig().attach(this); 3715 join(client.titleSig(),
3716 FbTk::MemFun(*this, &FluxboxWindow::setTitle));
3713} 3717}
3714 3718
3715FluxboxWindow::ReferenceCorner FluxboxWindow::getCorner(string str) { 3719FluxboxWindow::ReferenceCorner FluxboxWindow::getCorner(string str) {