moved slit handling over to Slit.cc and temporarly disabled slit save/load resources
This commit is contained in:
parent
346ed33abb
commit
f423bdc3a4
1 changed files with 106 additions and 228 deletions
136
src/fluxbox.cc
136
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.90 2003/01/10 00:44:17 fluxgen Exp $
|
||||
// $Id: fluxbox.cc,v 1.91 2003/01/12 18:11:12 fluxgen Exp $
|
||||
|
||||
|
||||
#include "fluxbox.hh"
|
||||
|
@ -366,14 +366,6 @@ Fluxbox::Fluxbox(int m_argc, char **m_argv, const char *dpy_name, const char *rc
|
|||
|
||||
masked = None;
|
||||
|
||||
#ifdef SLIT
|
||||
#ifdef KDE
|
||||
//For KDE dock applets
|
||||
kwm1_dockwindow = XInternAtom(getXDisplay(), "KWM_DOCKWINDOW", False); //KDE v1.x
|
||||
kwm2_dockwindow = XInternAtom(getXDisplay(), "_KDE_NET_WM_SYSTEM_TRAY_WINDOW_FOR", False); //KDE v2.x
|
||||
#endif //KDE
|
||||
|
||||
#endif // SLIT
|
||||
|
||||
#ifdef HAVE_GETPID
|
||||
fluxbox_pid = XInternAtom(getXDisplay(), "_BLACKBOX_PID", False);
|
||||
|
@ -576,18 +568,9 @@ void Fluxbox::handleEvent(XEvent * const e) {
|
|||
{
|
||||
FluxboxWindow *win = (FluxboxWindow *) 0;
|
||||
|
||||
#ifdef SLIT
|
||||
Slit *slit = (Slit *) 0;
|
||||
#endif // SLIT
|
||||
|
||||
if ((win = searchWindow(e->xconfigurerequest.window))) {
|
||||
win->configureRequestEvent(e->xconfigurerequest);
|
||||
|
||||
#ifdef SLIT
|
||||
} else if ((slit = searchSlit(e->xconfigurerequest.window))) {
|
||||
slit->configureRequestEvent(&e->xconfigurerequest);
|
||||
#endif // SLIT
|
||||
|
||||
} else {
|
||||
grab();
|
||||
|
||||
|
@ -616,49 +599,6 @@ void Fluxbox::handleEvent(XEvent * const e) {
|
|||
cerr<<"MapRequest for 0x"<<hex<<e->xmaprequest.window<<dec<<endl;
|
||||
#endif // DEBUG
|
||||
|
||||
#ifdef SLIT
|
||||
#ifdef KDE
|
||||
//Check and see if client is KDE dock applet.
|
||||
//If so add to Slit
|
||||
bool iskdedockapp = false;
|
||||
Atom ajunk;
|
||||
int ijunk;
|
||||
unsigned long *data = (unsigned long *) 0, uljunk;
|
||||
|
||||
// Check if KDE v2.x dock applet
|
||||
if (XGetWindowProperty(getXDisplay(), e->xmaprequest.window,
|
||||
getKWM2DockwindowAtom(), 0l, 1l, False,
|
||||
XA_WINDOW, &ajunk, &ijunk, &uljunk,
|
||||
&uljunk, (unsigned char **) &data) == Success) {
|
||||
|
||||
if (data)
|
||||
iskdedockapp = True;
|
||||
XFree((char *) data);
|
||||
|
||||
}
|
||||
|
||||
// Check if KDE v1.x dock applet
|
||||
if (!iskdedockapp) {
|
||||
if (XGetWindowProperty(getXDisplay(), e->xmaprequest.window,
|
||||
getKWM1DockwindowAtom(), 0l, 1l, False,
|
||||
getKWM1DockwindowAtom(), &ajunk, &ijunk, &uljunk,
|
||||
&uljunk, (unsigned char **) &data) == Success) {
|
||||
iskdedockapp = (data && data[0] != 0);
|
||||
XFree((char *) data);
|
||||
}
|
||||
}
|
||||
|
||||
if (iskdedockapp) {
|
||||
XSelectInput(getXDisplay(), e->xmaprequest.window, StructureNotifyMask);
|
||||
ScreenList::iterator it = screenList.begin();
|
||||
for (; (*it) == screenList.back(); ++it) {
|
||||
(*it)->getSlit()->addClient(e->xmaprequest.window);
|
||||
}
|
||||
return;
|
||||
}
|
||||
#endif //KDE
|
||||
#endif // SLIT
|
||||
|
||||
FluxboxWindow *win = searchWindow(e->xmaprequest.window);
|
||||
|
||||
if (! win) {
|
||||
|
@ -692,23 +632,13 @@ void Fluxbox::handleEvent(XEvent * const e) {
|
|||
case CreateNotify:
|
||||
break;
|
||||
case DestroyNotify: {
|
||||
FluxboxWindow *win = (FluxboxWindow *) 0;
|
||||
|
||||
#ifdef SLIT
|
||||
Slit *slit = 0;
|
||||
#endif // SLIT
|
||||
FluxboxWindow *win = 0;
|
||||
|
||||
if ((win = searchWindow(e->xdestroywindow.window)) && win->getClientWindow() == e->xdestroywindow.window) {
|
||||
win->destroyNotifyEvent(e->xdestroywindow);
|
||||
removeWindowSearch(win->getClientWindow());
|
||||
delete win;
|
||||
}
|
||||
#ifdef SLIT
|
||||
else if ((slit = searchSlit(e->xdestroywindow.window))) {
|
||||
slit->removeClient(e->xdestroywindow.window, false);
|
||||
|
||||
}
|
||||
#endif // SLIT
|
||||
|
||||
}
|
||||
break;
|
||||
|
@ -744,9 +674,6 @@ void Fluxbox::handleEvent(XEvent * const e) {
|
|||
BScreen *screen = 0;
|
||||
FluxboxWindow *win = 0;
|
||||
Tab *tab = 0;
|
||||
#ifdef SLIT
|
||||
Slit *slit = 0;
|
||||
#endif // SLIT
|
||||
|
||||
if (e->xcrossing.mode == NotifyGrab)
|
||||
break;
|
||||
|
@ -788,10 +715,6 @@ void Fluxbox::handleEvent(XEvent * const e) {
|
|||
ungrab();
|
||||
}
|
||||
}
|
||||
#ifdef SLIT
|
||||
else if ((slit = searchSlit(e->xcrossing.window)))
|
||||
slit->enterNotifyEvent(&e->xcrossing);
|
||||
#endif // SLIT
|
||||
|
||||
}
|
||||
break;
|
||||
|
@ -801,15 +724,8 @@ void Fluxbox::handleEvent(XEvent * const e) {
|
|||
|
||||
FluxboxWindow *win = (FluxboxWindow *) 0;
|
||||
|
||||
#ifdef SLIT
|
||||
Slit *slit = (Slit *) 0;
|
||||
#endif // SLIT
|
||||
if ((win = searchWindow(e->xcrossing.window)))
|
||||
win->installColormap(false);
|
||||
#ifdef SLIT
|
||||
else if ((slit = searchSlit(e->xcrossing.window)))
|
||||
slit->leaveNotifyEvent(&e->xcrossing);
|
||||
#endif // SLIT
|
||||
|
||||
}
|
||||
break;
|
||||
|
@ -875,9 +791,6 @@ void Fluxbox::handleButtonEvent(XButtonEvent &be) {
|
|||
|
||||
FluxboxWindow *win = 0;
|
||||
Tab *tab = 0;
|
||||
#ifdef SLIT
|
||||
Slit *slit = (Slit *) 0;
|
||||
#endif // SLIT
|
||||
|
||||
if ((win = searchWindow(be.window))) {
|
||||
|
||||
|
@ -886,11 +799,6 @@ void Fluxbox::handleButtonEvent(XButtonEvent &be) {
|
|||
if (be.button == 1)
|
||||
win->installColormap(True);
|
||||
}
|
||||
#ifdef SLIT
|
||||
else if ((slit = searchSlit(be.window))) {
|
||||
slit->buttonPressEvent(&be);
|
||||
}
|
||||
#endif // SLIT
|
||||
else if ((tab = searchTab(be.window))) {
|
||||
tab->buttonPressEvent(&be);
|
||||
} else {
|
||||
|
@ -1002,9 +910,6 @@ void Fluxbox::handleUnmapNotify(XUnmapEvent &ue) {
|
|||
|
||||
FluxboxWindow *win = 0;
|
||||
|
||||
#ifdef SLIT
|
||||
Slit *slit = (Slit *) 0;
|
||||
#endif // SLIT
|
||||
BScreen *screen = searchScreen(ue.event);
|
||||
|
||||
if ( (ue.event != ue.window) && (screen != 0 || !ue.send_event))
|
||||
|
@ -1022,11 +927,6 @@ void Fluxbox::handleUnmapNotify(XUnmapEvent &ue) {
|
|||
}
|
||||
|
||||
}
|
||||
#ifdef SLIT
|
||||
else if ((slit = searchSlit(ue.window))!=0) {
|
||||
slit->removeClient(ue.window);
|
||||
}
|
||||
#endif // SLIT
|
||||
|
||||
}
|
||||
|
||||
|
@ -1658,15 +1558,6 @@ Tab *Fluxbox::searchTab(Window window) {
|
|||
return it == tabSearch.end() ? 0 : it->second;
|
||||
}
|
||||
|
||||
|
||||
#ifdef SLIT
|
||||
Slit *Fluxbox::searchSlit(Window window) {
|
||||
std::map<Window, Slit *>::iterator it = slitSearch.find(window);
|
||||
return it == slitSearch.end() ? 0 : it->second;
|
||||
}
|
||||
#endif // SLIT
|
||||
|
||||
|
||||
void Fluxbox::saveWindowSearch(Window window, FluxboxWindow *data) {
|
||||
windowSearch[window] = data;
|
||||
}
|
||||
|
@ -1680,13 +1571,6 @@ void Fluxbox::saveTabSearch(Window window, Tab *data) {
|
|||
tabSearch[window] = data;
|
||||
}
|
||||
|
||||
#ifdef SLIT
|
||||
void Fluxbox::saveSlitSearch(Window window, Slit *data) {
|
||||
slitSearch[window] = data;
|
||||
}
|
||||
#endif // SLIT
|
||||
|
||||
|
||||
void Fluxbox::removeWindowSearch(Window window) {
|
||||
windowSearch.erase(window);
|
||||
}
|
||||
|
@ -1700,13 +1584,6 @@ void Fluxbox::removeTabSearch(Window window) {
|
|||
tabSearch.erase(window);
|
||||
}
|
||||
|
||||
#ifdef SLIT
|
||||
void Fluxbox::removeSlitSearch(Window window) {
|
||||
slitSearch.erase(window);
|
||||
}
|
||||
#endif // SLIT
|
||||
|
||||
|
||||
void Fluxbox::restart(const char *prog) {
|
||||
shutdown();
|
||||
|
||||
|
@ -1773,7 +1650,7 @@ void Fluxbox::save_rc() {
|
|||
for (; it != it_end; ++it) {
|
||||
BScreen *screen = *it;
|
||||
int screen_number = screen->getScreenNumber();
|
||||
|
||||
/*
|
||||
#ifdef SLIT
|
||||
string slit_placement;
|
||||
|
||||
|
@ -1812,7 +1689,7 @@ void Fluxbox::save_rc() {
|
|||
#endif // XINERAMA
|
||||
|
||||
#endif // SLIT
|
||||
|
||||
*/
|
||||
sprintf(rc_string, "session.screen%d.rowPlacementDirection: %s", screen_number,
|
||||
((screen->getRowPlacementDirection() == BScreen::LEFTRIGHT) ?
|
||||
"LeftToRight" : "RightToLeft"));
|
||||
|
@ -1933,6 +1810,7 @@ void Fluxbox::load_rc() {
|
|||
//get resource filename
|
||||
string dbfile(getRcFilename());
|
||||
|
||||
|
||||
if (dbfile.size() != 0) {
|
||||
if (!m_resourcemanager.load(dbfile.c_str())) {
|
||||
cerr<<"Faild to load database:"<<dbfile<<endl;
|
||||
|
@ -2132,7 +2010,7 @@ void Fluxbox::load_rc(BScreen *screen) {
|
|||
screen->savePlacementPolicy(BScreen::CASCADEPLACEMENT);
|
||||
} else
|
||||
screen->savePlacementPolicy(BScreen::ROWSMARTPLACEMENT);
|
||||
|
||||
/*
|
||||
#ifdef SLIT
|
||||
sprintf(name_lookup, "session.screen%d.slit.placement", screen_number);
|
||||
sprintf(class_lookup, "Session.Screen%d.Slit.Placement", screen_number);
|
||||
|
@ -2204,7 +2082,7 @@ void Fluxbox::load_rc(BScreen *screen) {
|
|||
#endif // XINERAMA
|
||||
|
||||
#endif // SLIT
|
||||
|
||||
*/
|
||||
#ifdef HAVE_STRFTIME
|
||||
sprintf(name_lookup, "session.screen%d.strftimeFormat", screen_number);
|
||||
sprintf(class_lookup, "Session.Screen%d.StrftimeFormat", screen_number);
|
||||
|
|
Loading…
Reference in a new issue