moved knowledge about '_NET_SYSTEM_TRAY_S' into the 'SystemTray' class
This commit is contained in:
parent
a1385e4018
commit
874eb67297
3 changed files with 17 additions and 13 deletions
|
@ -54,6 +54,7 @@
|
|||
#include "AtomHandler.hh"
|
||||
#include "HeadArea.hh"
|
||||
#include "FbCommands.hh"
|
||||
#include "SystemTray.hh"
|
||||
#include "Debug.hh"
|
||||
|
||||
#include "FbTk/I18n.hh"
|
||||
|
@ -1234,12 +1235,10 @@ bool BScreen::isKdeDockapp(Window client) const {
|
|||
bool BScreen::addKdeDockapp(Window client) {
|
||||
|
||||
XSelectInput(FbTk::App::instance()->display(), client, StructureNotifyMask);
|
||||
string atom_name("_NET_SYSTEM_TRAY_S");
|
||||
atom_name += FbTk::StringUtil::number2String(screenNumber());
|
||||
// find the right atomhandler that has the name: _NET_SYSTEM_TRAY_S<num>
|
||||
AtomHandler *handler = Fluxbox::instance()->getAtomHandler(atom_name);
|
||||
FbTk::EventHandler *evh = 0;
|
||||
FbTk::EventManager *evm = FbTk::EventManager::instance();
|
||||
|
||||
AtomHandler *handler = Fluxbox::instance()->getAtomHandler(SystemTray::getNetSystemTrayAtom(screenNumber()));
|
||||
if (handler == 0) {
|
||||
#ifdef SLIT
|
||||
if (slit() != 0 && slit()->acceptKdeDockapp())
|
||||
|
|
|
@ -177,11 +177,8 @@ SystemTray::SystemTray(const FbTk::FbWindow& parent,
|
|||
Fluxbox* fluxbox = Fluxbox::instance();
|
||||
Display *disp = fluxbox->display();
|
||||
|
||||
// setup atom name to _NET_SYSTEM_TRAY_S<screen number>
|
||||
string atom_name("_NET_SYSTEM_TRAY_S");
|
||||
atom_name += FbTk::StringUtil::number2String(m_window.screenNumber());
|
||||
|
||||
// get selection owner and see if it's free
|
||||
string atom_name = getNetSystemTrayAtom(m_window.screenNumber());
|
||||
Atom tray_atom = XInternAtom(disp, atom_name.c_str(), False);
|
||||
Window owner = XGetSelectionOwner(disp, tray_atom);
|
||||
if (owner != 0) {
|
||||
|
@ -225,11 +222,9 @@ SystemTray::~SystemTray() {
|
|||
Fluxbox* fluxbox = Fluxbox::instance();
|
||||
fluxbox->removeAtomHandler(m_handler.get());
|
||||
Display *disp = fluxbox->display();
|
||||
// setup atom name to _NET_SYSTEM_TRAY_S<screen number>
|
||||
string atom_name("_NET_SYSTEM_TRAY_S");
|
||||
atom_name += FbTk::StringUtil::number2String(m_window.screenNumber());
|
||||
|
||||
// get selection owner and see if it's free
|
||||
string atom_name = getNetSystemTrayAtom(m_window.screenNumber());
|
||||
Atom tray_atom = XInternAtom(disp, atom_name.c_str(), False);
|
||||
|
||||
// Properly give up selection.
|
||||
|
@ -553,6 +548,14 @@ void SystemTray::update() {
|
|||
}
|
||||
|
||||
Atom SystemTray::getXEmbedInfoAtom() {
|
||||
static Atom theatom = XInternAtom(Fluxbox::instance()->display(), "_XEMBED_INFO", False);
|
||||
return theatom;
|
||||
static Atom theatom = XInternAtom(Fluxbox::instance()->display(), "_XEMBED_INFO", False);
|
||||
return theatom;
|
||||
}
|
||||
|
||||
string SystemTray::getNetSystemTrayAtom(int screen_nr) {
|
||||
|
||||
string atom_name("_NET_SYSTEM_TRAY_S");
|
||||
atom_name += FbTk::StringUtil::number2String(screen_nr);
|
||||
|
||||
return atom_name;
|
||||
}
|
||||
|
|
|
@ -84,6 +84,8 @@ public:
|
|||
|
||||
void parentMoved() { m_window.parentMoved(); }
|
||||
|
||||
static std::string getNetSystemTrayAtom(int screen_nr);
|
||||
|
||||
static Atom getXEmbedInfoAtom();
|
||||
|
||||
private:
|
||||
|
|
Loading…
Reference in a new issue