From 40abe448b1a80325be090621a4f5fcef8698ca61 Mon Sep 17 00:00:00 2001 From: fluxgen Date: Tue, 31 Aug 2004 23:18:29 +0000 Subject: multiple screen fix, checks for screen number --- src/SystemTray.cc | 20 ++++++++++++++++---- 1 file 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 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: SystemTray.cc,v 1.12 2004/06/27 21:47:16 fluxgen Exp $ +// $Id: SystemTray.cc,v 1.13 2004/08/31 23:18:29 fluxgen Exp $ #include "SystemTray.hh" @@ -51,12 +51,20 @@ public: // client message is the only thing we care about bool checkClientMessage(const XClientMessageEvent &ce, BScreen * screen, WinClient * const winclient) { + // must be on the same screen + if ((screen && screen->screenNumber() != m_tray.window().screenNumber()) || + (winclient && winclient->screenNumber() != m_tray.window().screenNumber()) ) + return false; return m_tray.clientMessage(ce); } void initForScreen(BScreen &screen) { }; void setupFrame(FluxboxWindow &win) { }; void setupClient(WinClient &winclient) { + // must be on the same screen + if (winclient.screenNumber() != m_tray.window().screenNumber()) + return; + // we dont want a managed window if (winclient.fbwindow() != 0) return; @@ -248,13 +256,15 @@ void SystemTray::addClient(Window win) { if (it != m_clients.end()) return; + FbTk::FbWindow *traywin = new TrayWindow(win); + if (traywin->screenNumber() != window().screenNumber()) { + delete traywin; + return; + } #ifdef DEBUG cerr<<"SystemTray::"<<__FUNCTION__<<": 0x"<add(*this, win); FbTk::EventManager::instance()->addParent(*this, window()); @@ -262,6 +272,8 @@ void SystemTray::addClient(Window win) { traywin->reparent(m_window, 0, 0); traywin->show(); + if (m_clients.empty()) + show(); #ifdef DEBUG cerr<<"number of clients = "<