From bb991a0166fb5aed0f3b49658b7dc38c0fc2765a Mon Sep 17 00:00:00 2001 From: fluxgen Date: Mon, 19 Apr 2004 22:48:19 +0000 Subject: kde dockapps in systray --- src/SystemTray.cc | 28 ++++++++++++++++++++++++---- src/SystemTray.hh | 8 +++++--- src/fluxbox.cc | 14 +++++++++++--- src/fluxbox.hh | 6 +++--- 4 files changed, 43 insertions(+), 13 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 @@ // SystemTray.cc -// Copyright (c) 2003 Henrik Kinnunen (fluxgen at users.sourceforge.net) +// Copyright (c) 2003-2004 Henrik Kinnunen (fluxgen at users.sourceforge.net) // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), @@ -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.7 2004/04/18 21:18:28 fluxgen Exp $ +// $Id: SystemTray.cc,v 1.8 2004/04/19 22:48:19 fluxgen Exp $ #include "SystemTray.hh" @@ -27,8 +27,11 @@ #include "AtomHandler.hh" #include "fluxbox.hh" +#include "WinClient.hh" +#include "Screen.hh" #include +#include #include @@ -53,7 +56,18 @@ public: void initForScreen(BScreen &screen) { }; void setupFrame(FluxboxWindow &win) { }; - void setupClient(WinClient &winclient) { }; + void setupClient(WinClient &winclient) { + // we dont want a managed window + if (winclient.fbwindow() != 0) + return; + // if not kde dockapp... + if (!winclient.screen().isKdeDockapp(winclient.window())) + return; + winclient.setEventMask(StructureNotifyMask | + SubstructureNotifyMask | EnterWindowMask); + m_tray.addClient(winclient.window()); + + }; void updateWorkarea(BScreen &) { } void updateFocusedWindow(BScreen &, Window) { } @@ -103,7 +117,7 @@ SystemTray::SystemTray(const FbTk::FbWindow &parent): // set owner XSetSelectionOwner(disp, tray_atom, m_window.window(), CurrentTime); m_handler.reset(new SystemTrayHandler(*this)); - Fluxbox::instance()->addAtomHandler(m_handler.get(), "systray"); + Fluxbox::instance()->addAtomHandler(m_handler.get(), atom_name); Window root_window = RootWindow(disp, m_window.screenNumber()); // send selection owner msg @@ -207,6 +221,7 @@ SystemTray::ClientList::iterator SystemTray::findClient(Window win) { void SystemTray::addClient(Window win) { if (win == 0) return; + cerr<<"Add client: "< ClientList; ClientList::iterator findClient(Window win); - void addClient(Window win); - void removeClient(Window win); + void renderTheme(); void rearrangeClients(); void removeAllClients(); diff --git a/src/fluxbox.cc b/src/fluxbox.cc index 9bff0e7..05b4ec2 100644 --- a/src/fluxbox.cc +++ b/src/fluxbox.cc @@ -22,7 +22,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: fluxbox.cc,v 1.238 2004/04/18 21:16:06 fluxgen Exp $ +// $Id: fluxbox.cc,v 1.239 2004/04/19 22:45:44 fluxgen Exp $ #include "fluxbox.hh" @@ -516,6 +516,8 @@ Fluxbox::Fluxbox(int argc, char **argv, const char *dpy_name, const char *rcfile delete screen; continue; } + // now it's safe to create windows + screen->initWindows(); #ifdef HAVE_GETPID pid_t bpid = getpid(); @@ -543,6 +545,8 @@ Fluxbox::Fluxbox(int argc, char **argv, const char *dpy_name, const char *rcfile m_toolbars.push_back(new Toolbar(*screen, *screen->layerManager().getLayer(Fluxbox::instance()->getNormalLayer()))); #endif // USE_TOOLBAR + // must do this after systray is created + screen->setupKdeDockapps(); // attach screen signals to this screen->currentWorkspaceSig().attach(this); @@ -559,6 +563,10 @@ Fluxbox::Fluxbox(int argc, char **argv, const char *dpy_name, const char *rcfile } revertFocus(*screen); // make sure focus style is correct +#ifdef SLIT + if (screen->slit()) + screen->slit()->show(); +#endif // SLIT } // end init screens @@ -1474,7 +1482,7 @@ BScreen *Fluxbox::searchScreen(Window window) { } -const AtomHandler* Fluxbox::getAtomHandler(std::string name) { +AtomHandler* Fluxbox::getAtomHandler(const std::string &name) { if ( name != "" ) { for (AtomHandlerContainerIt it= m_atomhandler.begin(); it != m_atomhandler.end(); it++ ) { @@ -1484,7 +1492,7 @@ const AtomHandler* Fluxbox::getAtomHandler(std::string name) { } return 0; } -void Fluxbox::addAtomHandler(AtomHandler *atomh, std::string name) { +void Fluxbox::addAtomHandler(AtomHandler *atomh, const std::string &name) { m_atomhandler[atomh]= name;; } diff --git a/src/fluxbox.hh b/src/fluxbox.hh index 8c4630f..2625ec0 100644 --- a/src/fluxbox.hh +++ b/src/fluxbox.hh @@ -22,7 +22,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: fluxbox.hh,v 1.85 2004/04/18 21:16:06 fluxgen Exp $ +// $Id: fluxbox.hh,v 1.86 2004/04/19 22:45:44 fluxgen Exp $ #ifndef FLUXBOX_HH #define FLUXBOX_HH @@ -101,8 +101,8 @@ public: inline unsigned int getUpdateDelayTime() const { return *m_rc_update_delay_time; } inline Time getLastTime() const { return m_last_time; } - const AtomHandler* getAtomHandler(std::string name); - void addAtomHandler(AtomHandler *atomh, std::string name= ""); + AtomHandler *getAtomHandler(const std::string &name); + void addAtomHandler(AtomHandler *atomh, const std::string &name); void removeAtomHandler(AtomHandler *atomh); /// obsolete -- cgit v0.11.2