kde dockapps in systray
This commit is contained in:
parent
2065957785
commit
bb991a0166
4 changed files with 43 additions and 13 deletions
|
@ -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 <X11/Xutil.h>
|
||||
#include <X11/Xatom.h>
|
||||
|
||||
#include <string>
|
||||
|
||||
|
@ -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: "<<win<<endl;
|
||||
|
||||
ClientList::iterator it = findClient(win);
|
||||
if (it != m_clients.end())
|
||||
|
@ -258,6 +273,11 @@ void SystemTray::exposeEvent(XExposeEvent &event) {
|
|||
void SystemTray::handleEvent(XEvent &event) {
|
||||
if (event.type == DestroyNotify) {
|
||||
removeClient(event.xdestroywindow.window);
|
||||
} else if (event.type == UnmapNotify && event.xany.send_event) {
|
||||
// we ignore server-generated events, which can occur
|
||||
// on restart. The ICCCM says that a client must send
|
||||
// a synthetic event for the withdrawn state
|
||||
removeClient(event.xunmap.window);
|
||||
} else if (event.type == ConfigureNotify) {
|
||||
// we got configurenotify from an client
|
||||
// check and see if we need to update it's size
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
// $Id: SystemTray.hh,v 1.3 2003/10/31 10:37:09 rathnor Exp $
|
||||
// $Id: SystemTray.hh,v 1.4 2004/04/19 22:48:19 fluxgen Exp $
|
||||
|
||||
#ifndef SYSTEMTRAY_HH
|
||||
#define SYSTEMTRAY_HH
|
||||
|
@ -55,6 +55,9 @@ public:
|
|||
void exposeEvent(XExposeEvent &event);
|
||||
void handleEvent(XEvent &event);
|
||||
|
||||
void addClient(Window win);
|
||||
void removeClient(Window win);
|
||||
|
||||
unsigned int width() const;
|
||||
unsigned int height() const;
|
||||
unsigned int borderWidth() const;
|
||||
|
@ -65,8 +68,7 @@ public:
|
|||
private:
|
||||
typedef std::list<FbTk::FbWindow *> ClientList;
|
||||
ClientList::iterator findClient(Window win);
|
||||
void addClient(Window win);
|
||||
void removeClient(Window win);
|
||||
|
||||
void renderTheme();
|
||||
void rearrangeClients();
|
||||
void removeAllClients();
|
||||
|
|
|
@ -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;;
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue