diff options
-rw-r--r-- | src/SystemTray.cc | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/SystemTray.cc b/src/SystemTray.cc index af34552..e752409 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.14 2004/09/01 00:05:52 fluxgen Exp $ | 22 | // $Id: SystemTray.cc,v 1.15 2004/09/01 08:46:55 fluxgen Exp $ |
23 | 23 | ||
24 | #include "SystemTray.hh" | 24 | #include "SystemTray.hh" |
25 | 25 | ||
@@ -260,11 +260,18 @@ void SystemTray::addClient(Window win) { | |||
260 | if (it != m_clients.end()) | 260 | if (it != m_clients.end()) |
261 | return; | 261 | return; |
262 | 262 | ||
263 | FbTk::FbWindow *traywin = new TrayWindow(win); | 263 | // make sure we have the same screen number |
264 | if (traywin->screenNumber() != window().screenNumber()) { | 264 | XWindowAttributes attr; |
265 | delete traywin; | 265 | attr.screen = 0; |
266 | if (XGetWindowAttributes(FbTk::App::instance()->display(), | ||
267 | win, &attr) != 0 && | ||
268 | attr.screen != 0 && | ||
269 | XScreenNumberOfScreen(attr.screen) != window().screenNumber()) { | ||
266 | return; | 270 | return; |
267 | } | 271 | } |
272 | |||
273 | FbTk::FbWindow *traywin = new TrayWindow(win); | ||
274 | |||
268 | #ifdef DEBUG | 275 | #ifdef DEBUG |
269 | cerr<<"SystemTray::"<<__FUNCTION__<<": 0x"<<hex<<win<<dec<<endl; | 276 | cerr<<"SystemTray::"<<__FUNCTION__<<": 0x"<<hex<<win<<dec<<endl; |
270 | #endif // DEBUG | 277 | #endif // DEBUG |