diff options
author | Mathias Gumz <akira at fluxbox dot org> | 2008-08-14 05:52:39 (GMT) |
---|---|---|
committer | Mathias Gumz <akira at fluxbox dot org> | 2008-08-14 05:52:39 (GMT) |
commit | e169d33552c8e7070aa6e13da0187f2013b4cfc3 (patch) | |
tree | ae9e92c7e885791c7f47645184070cbcd441ab94 /src/SystemTray.cc | |
parent | c82e7c0080f8a5c14dcf95ec92dc42f59ea9dd8b (diff) | |
parent | 91ca3bc5c8e2b892a9a81b18246f72aba7deebfd (diff) | |
download | fluxbox_paul-e169d33552c8e7070aa6e13da0187f2013b4cfc3.zip fluxbox_paul-e169d33552c8e7070aa6e13da0187f2013b4cfc3.tar.bz2 |
Merge branch 'master' into to_push
Diffstat (limited to 'src/SystemTray.cc')
-rw-r--r-- | src/SystemTray.cc | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/SystemTray.cc b/src/SystemTray.cc index 5aa7323..699ca47 100644 --- a/src/SystemTray.cc +++ b/src/SystemTray.cc | |||
@@ -30,6 +30,7 @@ | |||
30 | #include "WinClient.hh" | 30 | #include "WinClient.hh" |
31 | #include "Screen.hh" | 31 | #include "Screen.hh" |
32 | #include "ButtonTheme.hh" | 32 | #include "ButtonTheme.hh" |
33 | #include "SimpleObserver.hh" | ||
33 | 34 | ||
34 | #include <X11/Xutil.h> | 35 | #include <X11/Xutil.h> |
35 | #include <X11/Xatom.h> | 36 | #include <X11/Xatom.h> |
@@ -155,7 +156,7 @@ private: | |||
155 | }; | 156 | }; |
156 | 157 | ||
157 | SystemTray::SystemTray(const FbTk::FbWindow& parent, | 158 | SystemTray::SystemTray(const FbTk::FbWindow& parent, |
158 | FbTk::ThemeProxy<ButtonTheme> &theme, BScreen& screen): | 159 | FbTk::ThemeProxy<ToolTheme> &theme, BScreen& screen): |
159 | ToolbarItem(ToolbarItem::FIXED), | 160 | ToolbarItem(ToolbarItem::FIXED), |
160 | m_window(parent, 0, 0, 1, 1, ExposureMask | ButtonPressMask | ButtonReleaseMask | | 161 | m_window(parent, 0, 0, 1, 1, ExposureMask | ButtonPressMask | ButtonReleaseMask | |
161 | SubstructureNotifyMask | SubstructureRedirectMask), | 162 | SubstructureNotifyMask | SubstructureRedirectMask), |
@@ -166,8 +167,10 @@ SystemTray::SystemTray(const FbTk::FbWindow& parent, | |||
166 | 167 | ||
167 | FbTk::EventManager::instance()->add(*this, m_window); | 168 | FbTk::EventManager::instance()->add(*this, m_window); |
168 | FbTk::EventManager::instance()->add(*this, m_selection_owner); | 169 | FbTk::EventManager::instance()->add(*this, m_selection_owner); |
169 | m_theme->reconfigSig().attach(this); | 170 | // setup signals |
170 | screen.bgChangeSig().attach(this); | 171 | m_observer.reset(makeObserver(*this, &SystemTray::update)); |
172 | m_theme->reconfigSig().attach(m_observer.get()); | ||
173 | screen.bgChangeSig().attach(m_observer.get()); | ||
171 | 174 | ||
172 | Fluxbox* fluxbox = Fluxbox::instance(); | 175 | Fluxbox* fluxbox = Fluxbox::instance(); |
173 | Display *disp = fluxbox->display(); | 176 | Display *disp = fluxbox->display(); |
@@ -216,7 +219,7 @@ SystemTray::SystemTray(const FbTk::FbWindow& parent, | |||
216 | 219 | ||
217 | XSendEvent(disp, root_window, false, StructureNotifyMask, &ce); | 220 | XSendEvent(disp, root_window, false, StructureNotifyMask, &ce); |
218 | 221 | ||
219 | update(0); | 222 | update(); |
220 | } | 223 | } |
221 | 224 | ||
222 | SystemTray::~SystemTray() { | 225 | SystemTray::~SystemTray() { |
@@ -276,7 +279,7 @@ void SystemTray::hide() { | |||
276 | 279 | ||
277 | void SystemTray::show() { | 280 | void SystemTray::show() { |
278 | 281 | ||
279 | update(0); | 282 | update(); |
280 | m_window.show(); | 283 | m_window.show(); |
281 | } | 284 | } |
282 | 285 | ||
@@ -470,7 +473,7 @@ void SystemTray::rearrangeClients() { | |||
470 | unsigned int trayw = m_num_visible_clients*h_rot0 + bw, trayh = h_rot0; | 473 | unsigned int trayw = m_num_visible_clients*h_rot0 + bw, trayh = h_rot0; |
471 | FbTk::translateSize(orientation(), trayw, trayh); | 474 | FbTk::translateSize(orientation(), trayw, trayh); |
472 | resize(trayw, trayh); | 475 | resize(trayw, trayh); |
473 | update(0); | 476 | update(); |
474 | 477 | ||
475 | // move and resize clients | 478 | // move and resize clients |
476 | ClientList::iterator client_it = m_clients.begin(); | 479 | ClientList::iterator client_it = m_clients.begin(); |
@@ -529,7 +532,7 @@ void SystemTray::showClient(TrayWindow *traywin) { | |||
529 | rearrangeClients(); | 532 | rearrangeClients(); |
530 | } | 533 | } |
531 | 534 | ||
532 | void SystemTray::update(FbTk::Subject* subject) { | 535 | void SystemTray::update() { |
533 | 536 | ||
534 | if (!m_theme->texture().usePixmap()) { | 537 | if (!m_theme->texture().usePixmap()) { |
535 | m_window.setBackgroundColor(m_theme->texture().color()); | 538 | m_window.setBackgroundColor(m_theme->texture().color()); |