diff options
Diffstat (limited to 'src/ClientMenu.cc')
-rw-r--r-- | src/ClientMenu.cc | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/ClientMenu.cc b/src/ClientMenu.cc index f5af305..0da3773 100644 --- a/src/ClientMenu.cc +++ b/src/ClientMenu.cc | |||
@@ -1,5 +1,5 @@ | |||
1 | // ClientMenu.hh | 1 | // ClientMenu.hh |
2 | // Copyright (c) 2007 Fluxbox Team (fluxgen at fluxbox dot org) | 2 | // Copyright (c) 2007-2008 Fluxbox Team (fluxgen at fluxbox dot org) |
3 | // | 3 | // |
4 | // Permission is hereby granted, free of charge, to any person obtaining a | 4 | // Permission is hereby granted, free of charge, to any person obtaining a |
5 | // copy of this software and associated documentation files (the "Software"), | 5 | // copy of this software and associated documentation files (the "Software"), |
@@ -28,6 +28,7 @@ | |||
28 | #include <X11/keysym.h> | 28 | #include <X11/keysym.h> |
29 | 29 | ||
30 | #include "FbTk/MenuItem.hh" | 30 | #include "FbTk/MenuItem.hh" |
31 | #include "FbTk/MemFun.hh" | ||
31 | 32 | ||
32 | namespace { // anonymous | 33 | namespace { // anonymous |
33 | 34 | ||
@@ -79,14 +80,16 @@ private: | |||
79 | }; // end anonymous namespace | 80 | }; // end anonymous namespace |
80 | 81 | ||
81 | ClientMenu::ClientMenu(BScreen &screen, Focusables &clients, | 82 | ClientMenu::ClientMenu(BScreen &screen, Focusables &clients, |
82 | FbTk::Subject *refresh): | 83 | bool listen_for_iconlist_changes): |
83 | FbMenu(screen.menuTheme(), screen.imageControl(), | 84 | FbMenu(screen.menuTheme(), screen.imageControl(), |
84 | *screen.layerManager().getLayer(Layer::MENU)), | 85 | *screen.layerManager().getLayer(Layer::MENU)), |
85 | m_list(clients), | 86 | m_list(clients) { |
86 | m_refresh_sig(refresh) { | 87 | |
88 | if (listen_for_iconlist_changes) { | ||
89 | m_slots.join(screen.iconListSig(), | ||
90 | FbTk::MemFun(*this, &ClientMenu::updateClientList)); | ||
91 | } | ||
87 | 92 | ||
88 | if (refresh) | ||
89 | refresh->attach(this); | ||
90 | refreshMenu(); | 93 | refreshMenu(); |
91 | 94 | ||
92 | } | 95 | } |
@@ -116,9 +119,7 @@ void ClientMenu::refreshMenu() { | |||
116 | } | 119 | } |
117 | 120 | ||
118 | void ClientMenu::update(FbTk::Subject *subj) { | 121 | void ClientMenu::update(FbTk::Subject *subj) { |
119 | if (subj == m_refresh_sig) | 122 | if (subj && typeid(*subj) == typeid(Focusable::FocusSubject)) { |
120 | refreshMenu(); | ||
121 | else if (subj && typeid(*subj) == typeid(Focusable::FocusSubject)) { | ||
122 | 123 | ||
123 | Focusable::FocusSubject *fsubj = static_cast<Focusable::FocusSubject *>(subj); | 124 | Focusable::FocusSubject *fsubj = static_cast<Focusable::FocusSubject *>(subj); |
124 | Focusable &win = fsubj->win(); | 125 | Focusable &win = fsubj->win(); |