aboutsummaryrefslogtreecommitdiff
path: root/src/SystemTray.cc
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2004-04-19 22:48:19 (GMT)
committerfluxgen <fluxgen>2004-04-19 22:48:19 (GMT)
commitbb991a0166fb5aed0f3b49658b7dc38c0fc2765a (patch)
treec9b7ca370a297233e5188d1c55e295bbbd3841b0 /src/SystemTray.cc
parent20659577859fc0fc85aeaa82f7a6e1e41f17e5e7 (diff)
downloadfluxbox-bb991a0166fb5aed0f3b49658b7dc38c0fc2765a.zip
fluxbox-bb991a0166fb5aed0f3b49658b7dc38c0fc2765a.tar.bz2
kde dockapps in systray
Diffstat (limited to 'src/SystemTray.cc')
-rw-r--r--src/SystemTray.cc28
1 files changed, 24 insertions, 4 deletions
diff --git a/src/SystemTray.cc b/src/SystemTray.cc
index bf3bc7d..215adce 100644
--- a/src/SystemTray.cc
+++ b/src/SystemTray.cc
@@ -1,5 +1,5 @@
1// SystemTray.cc 1// SystemTray.cc
2// Copyright (c) 2003 Henrik Kinnunen (fluxgen at users.sourceforge.net) 2// Copyright (c) 2003-2004 Henrik Kinnunen (fluxgen at users.sourceforge.net)
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"),
@@ -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.7 2004/04/18 21:18:28 fluxgen Exp $ 22// $Id: SystemTray.cc,v 1.8 2004/04/19 22:48:19 fluxgen Exp $
23 23
24#include "SystemTray.hh" 24#include "SystemTray.hh"
25 25
@@ -27,8 +27,11 @@
27 27
28#include "AtomHandler.hh" 28#include "AtomHandler.hh"
29#include "fluxbox.hh" 29#include "fluxbox.hh"
30#include "WinClient.hh"
31#include "Screen.hh"
30 32
31#include <X11/Xutil.h> 33#include <X11/Xutil.h>
34#include <X11/Xatom.h>
32 35
33#include <string> 36#include <string>
34 37
@@ -53,7 +56,18 @@ public:
53 56
54 void initForScreen(BScreen &screen) { }; 57 void initForScreen(BScreen &screen) { };
55 void setupFrame(FluxboxWindow &win) { }; 58 void setupFrame(FluxboxWindow &win) { };
56 void setupClient(WinClient &winclient) { }; 59 void setupClient(WinClient &winclient) {
60 // we dont want a managed window
61 if (winclient.fbwindow() != 0)
62 return;
63 // if not kde dockapp...
64 if (!winclient.screen().isKdeDockapp(winclient.window()))
65 return;
66 winclient.setEventMask(StructureNotifyMask |
67 SubstructureNotifyMask | EnterWindowMask);
68 m_tray.addClient(winclient.window());
69
70 };
57 71
58 void updateWorkarea(BScreen &) { } 72 void updateWorkarea(BScreen &) { }
59 void updateFocusedWindow(BScreen &, Window) { } 73 void updateFocusedWindow(BScreen &, Window) { }
@@ -103,7 +117,7 @@ SystemTray::SystemTray(const FbTk::FbWindow &parent):
103 // set owner 117 // set owner
104 XSetSelectionOwner(disp, tray_atom, m_window.window(), CurrentTime); 118 XSetSelectionOwner(disp, tray_atom, m_window.window(), CurrentTime);
105 m_handler.reset(new SystemTrayHandler(*this)); 119 m_handler.reset(new SystemTrayHandler(*this));
106 Fluxbox::instance()->addAtomHandler(m_handler.get(), "systray"); 120 Fluxbox::instance()->addAtomHandler(m_handler.get(), atom_name);
107 Window root_window = RootWindow(disp, m_window.screenNumber()); 121 Window root_window = RootWindow(disp, m_window.screenNumber());
108 122
109 // send selection owner msg 123 // send selection owner msg
@@ -207,6 +221,7 @@ SystemTray::ClientList::iterator SystemTray::findClient(Window win) {
207void SystemTray::addClient(Window win) { 221void SystemTray::addClient(Window win) {
208 if (win == 0) 222 if (win == 0)
209 return; 223 return;
224 cerr<<"Add client: "<<win<<endl;
210 225
211 ClientList::iterator it = findClient(win); 226 ClientList::iterator it = findClient(win);
212 if (it != m_clients.end()) 227 if (it != m_clients.end())
@@ -258,6 +273,11 @@ void SystemTray::exposeEvent(XExposeEvent &event) {
258void SystemTray::handleEvent(XEvent &event) { 273void SystemTray::handleEvent(XEvent &event) {
259 if (event.type == DestroyNotify) { 274 if (event.type == DestroyNotify) {
260 removeClient(event.xdestroywindow.window); 275 removeClient(event.xdestroywindow.window);
276 } else if (event.type == UnmapNotify && event.xany.send_event) {
277 // we ignore server-generated events, which can occur
278 // on restart. The ICCCM says that a client must send
279 // a synthetic event for the withdrawn state
280 removeClient(event.xunmap.window);
261 } else if (event.type == ConfigureNotify) { 281 } else if (event.type == ConfigureNotify) {
262 // we got configurenotify from an client 282 // we got configurenotify from an client
263 // check and see if we need to update it's size 283 // check and see if we need to update it's size