aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/SystemTray.cc20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/SystemTray.cc b/src/SystemTray.cc
index 728b6bb..61eb95a 100644
--- a/src/SystemTray.cc
+++ b/src/SystemTray.cc
@@ -19,7 +19,7 @@
19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20// DEALINGS IN THE SOFTWARE. 20// DEALINGS IN THE SOFTWARE.
21 21
22// $Id: SystemTray.cc,v 1.12 2004/06/27 21:47:16 fluxgen Exp $ 22// $Id: SystemTray.cc,v 1.13 2004/08/31 23:18:29 fluxgen Exp $
23 23
24#include "SystemTray.hh" 24#include "SystemTray.hh"
25 25
@@ -51,12 +51,20 @@ public:
51 // client message is the only thing we care about 51 // client message is the only thing we care about
52 bool checkClientMessage(const XClientMessageEvent &ce, 52 bool checkClientMessage(const XClientMessageEvent &ce,
53 BScreen * screen, WinClient * const winclient) { 53 BScreen * screen, WinClient * const winclient) {
54 // must be on the same screen
55 if ((screen && screen->screenNumber() != m_tray.window().screenNumber()) ||
56 (winclient && winclient->screenNumber() != m_tray.window().screenNumber()) )
57 return false;
54 return m_tray.clientMessage(ce); 58 return m_tray.clientMessage(ce);
55 } 59 }
56 60
57 void initForScreen(BScreen &screen) { }; 61 void initForScreen(BScreen &screen) { };
58 void setupFrame(FluxboxWindow &win) { }; 62 void setupFrame(FluxboxWindow &win) { };
59 void setupClient(WinClient &winclient) { 63 void setupClient(WinClient &winclient) {
64 // must be on the same screen
65 if (winclient.screenNumber() != m_tray.window().screenNumber())
66 return;
67
60 // we dont want a managed window 68 // we dont want a managed window
61 if (winclient.fbwindow() != 0) 69 if (winclient.fbwindow() != 0)
62 return; 70 return;
@@ -248,13 +256,15 @@ void SystemTray::addClient(Window win) {
248 if (it != m_clients.end()) 256 if (it != m_clients.end())
249 return; 257 return;
250 258
259 FbTk::FbWindow *traywin = new TrayWindow(win);
260 if (traywin->screenNumber() != window().screenNumber()) {
261 delete traywin;
262 return;
263 }
251#ifdef DEBUG 264#ifdef DEBUG
252 cerr<<"SystemTray::"<<__FUNCTION__<<": 0x"<<hex<<win<<dec<<endl; 265 cerr<<"SystemTray::"<<__FUNCTION__<<": 0x"<<hex<<win<<dec<<endl;
253#endif // DEBUG 266#endif // DEBUG
254 if (m_clients.empty())
255 show();
256 267
257 FbTk::FbWindow *traywin = new TrayWindow(win);
258 m_clients.push_back(traywin); 268 m_clients.push_back(traywin);
259 FbTk::EventManager::instance()->add(*this, win); 269 FbTk::EventManager::instance()->add(*this, win);
260 FbTk::EventManager::instance()->addParent(*this, window()); 270 FbTk::EventManager::instance()->addParent(*this, window());
@@ -262,6 +272,8 @@ void SystemTray::addClient(Window win) {
262 traywin->reparent(m_window, 0, 0); 272 traywin->reparent(m_window, 0, 0);
263 traywin->show(); 273 traywin->show();
264 274
275 if (m_clients.empty())
276 show();
265#ifdef DEBUG 277#ifdef DEBUG
266 cerr<<"number of clients = "<<m_clients.size()<<endl; 278 cerr<<"number of clients = "<<m_clients.size()<<endl;
267#endif // DEBUG 279#endif // DEBUG