adjusted for fluxboxwindow referens events, updated fbwin configure to moveresize, moved creation of fluxboxwindow object to BScreen
This commit is contained in:
parent
f61ff3329e
commit
9195cea6e7
1 changed files with 83 additions and 93 deletions
176
src/fluxbox.cc
176
src/fluxbox.cc
|
@ -22,7 +22,7 @@
|
||||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||||
// DEALINGS IN THE SOFTWARE.
|
// DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
// $Id: fluxbox.cc,v 1.87 2002/12/09 22:21:00 fluxgen Exp $
|
// $Id: fluxbox.cc,v 1.88 2003/01/05 22:41:21 fluxgen Exp $
|
||||||
|
|
||||||
|
|
||||||
#include "fluxbox.hh"
|
#include "fluxbox.hh"
|
||||||
|
@ -561,7 +561,7 @@ void Fluxbox::handleEvent(XEvent * const e) {
|
||||||
if ((masked == e->xany.window) && masked_window &&
|
if ((masked == e->xany.window) && masked_window &&
|
||||||
(e->type == MotionNotify)) {
|
(e->type == MotionNotify)) {
|
||||||
last_time = e->xmotion.time;
|
last_time = e->xmotion.time;
|
||||||
masked_window->motionNotifyEvent(&e->xmotion);
|
masked_window->motionNotifyEvent(e->xmotion);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -582,7 +582,7 @@ void Fluxbox::handleEvent(XEvent * const e) {
|
||||||
#endif // SLIT
|
#endif // SLIT
|
||||||
|
|
||||||
if ((win = searchWindow(e->xconfigurerequest.window))) {
|
if ((win = searchWindow(e->xconfigurerequest.window))) {
|
||||||
win->configureRequestEvent(&e->xconfigurerequest);
|
win->configureRequestEvent(e->xconfigurerequest);
|
||||||
|
|
||||||
#ifdef SLIT
|
#ifdef SLIT
|
||||||
} else if ((slit = searchSlit(e->xconfigurerequest.window))) {
|
} else if ((slit = searchSlit(e->xconfigurerequest.window))) {
|
||||||
|
@ -612,83 +612,76 @@ void Fluxbox::handleEvent(XEvent * const e) {
|
||||||
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case MapRequest:
|
case MapRequest: {
|
||||||
{
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
fprintf(stderr,
|
cerr<<"MapRequest for 0x"<<hex<<e->xmaprequest.window<<dec<<endl;
|
||||||
I18n::instance()->
|
|
||||||
getMessage(
|
|
||||||
FBNLS::blackboxSet, FBNLS::blackboxMapRequest,
|
|
||||||
"Fluxbox::process_event(): MapRequest for 0x%lx\n"),
|
|
||||||
e->xmaprequest.window);
|
|
||||||
#endif // DEBUG
|
#endif // DEBUG
|
||||||
|
|
||||||
#ifdef SLIT
|
#ifdef SLIT
|
||||||
#ifdef KDE
|
#ifdef KDE
|
||||||
//Check and see if client is KDE dock applet.
|
//Check and see if client is KDE dock applet.
|
||||||
//If so add to Slit
|
//If so add to Slit
|
||||||
bool iskdedockapp = false;
|
bool iskdedockapp = false;
|
||||||
Atom ajunk;
|
Atom ajunk;
|
||||||
int ijunk;
|
int ijunk;
|
||||||
unsigned long *data = (unsigned long *) 0, uljunk;
|
unsigned long *data = (unsigned long *) 0, uljunk;
|
||||||
|
|
||||||
// Check if KDE v2.x dock applet
|
// Check if KDE v2.x dock applet
|
||||||
if (XGetWindowProperty(getXDisplay(), e->xmaprequest.window,
|
if (XGetWindowProperty(getXDisplay(), e->xmaprequest.window,
|
||||||
getKWM2DockwindowAtom(), 0l, 1l, False,
|
getKWM2DockwindowAtom(), 0l, 1l, False,
|
||||||
XA_WINDOW, &ajunk, &ijunk, &uljunk,
|
XA_WINDOW, &ajunk, &ijunk, &uljunk,
|
||||||
&uljunk, (unsigned char **) &data) == Success) {
|
&uljunk, (unsigned char **) &data) == Success) {
|
||||||
|
|
||||||
if (data)
|
if (data)
|
||||||
iskdedockapp = True;
|
iskdedockapp = True;
|
||||||
XFree((char *) data);
|
XFree((char *) data);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if KDE v1.x dock applet
|
// Check if KDE v1.x dock applet
|
||||||
if (!iskdedockapp) {
|
if (!iskdedockapp) {
|
||||||
if (XGetWindowProperty(getXDisplay(), e->xmaprequest.window,
|
if (XGetWindowProperty(getXDisplay(), e->xmaprequest.window,
|
||||||
getKWM1DockwindowAtom(), 0l, 1l, False,
|
getKWM1DockwindowAtom(), 0l, 1l, False,
|
||||||
getKWM1DockwindowAtom(), &ajunk, &ijunk, &uljunk,
|
getKWM1DockwindowAtom(), &ajunk, &ijunk, &uljunk,
|
||||||
&uljunk, (unsigned char **) &data) == Success) {
|
&uljunk, (unsigned char **) &data) == Success) {
|
||||||
iskdedockapp = (data && data[0] != 0);
|
iskdedockapp = (data && data[0] != 0);
|
||||||
XFree((char *) data);
|
XFree((char *) data);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (iskdedockapp) {
|
if (iskdedockapp) {
|
||||||
XSelectInput(getXDisplay(), e->xmaprequest.window, StructureNotifyMask);
|
XSelectInput(getXDisplay(), e->xmaprequest.window, StructureNotifyMask);
|
||||||
ScreenList::iterator it = screenList.begin();
|
ScreenList::iterator it = screenList.begin();
|
||||||
for (; (*it) == screenList.back(); ++it) {
|
for (; (*it) == screenList.back(); ++it) {
|
||||||
(*it)->getSlit()->addClient(e->xmaprequest.window);
|
(*it)->getSlit()->addClient(e->xmaprequest.window);
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
#endif //KDE
|
#endif //KDE
|
||||||
#endif // SLIT
|
#endif // SLIT
|
||||||
|
|
||||||
FluxboxWindow *win = searchWindow(e->xmaprequest.window);
|
FluxboxWindow *win = searchWindow(e->xmaprequest.window);
|
||||||
|
|
||||||
if (! win) {
|
|
||||||
win = new FluxboxWindow(e->xmaprequest.window);
|
|
||||||
if (!win->isManaged()) {
|
|
||||||
delete win;
|
|
||||||
win = 0;
|
|
||||||
} else {
|
|
||||||
// attach signals
|
|
||||||
attachSignals(*win);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((win = searchWindow(e->xmaprequest.window)))
|
|
||||||
win->mapRequestEvent(&e->xmaprequest);
|
|
||||||
|
|
||||||
|
if (! win) {
|
||||||
|
//!!! TODO
|
||||||
|
BScreen *scr = searchScreen(e->xmaprequest.parent);
|
||||||
|
cerr<<"screen = "<<scr<<endl;
|
||||||
|
if (scr != 0)
|
||||||
|
scr->createWindow(e->xmaprequest.window);
|
||||||
|
else
|
||||||
|
cerr<<"Fluxbox Warning! Could not find screen to map window on!"<<endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((win = searchWindow(e->xmaprequest.window)))
|
||||||
|
win->mapRequestEvent(e->xmaprequest);
|
||||||
|
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case MapNotify:
|
case MapNotify:
|
||||||
{
|
{
|
||||||
FluxboxWindow *win = searchWindow(e->xmap.window);
|
FluxboxWindow *win = searchWindow(e->xmap.window);
|
||||||
if (win != 0)
|
if (win != 0)
|
||||||
win->mapNotifyEvent(&e->xmap);
|
win->mapNotifyEvent(e->xmap);
|
||||||
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -706,12 +699,10 @@ void Fluxbox::handleEvent(XEvent * const e) {
|
||||||
Slit *slit = 0;
|
Slit *slit = 0;
|
||||||
#endif // SLIT
|
#endif // SLIT
|
||||||
|
|
||||||
if ((win = searchWindow(e->xdestroywindow.window))) {
|
if ((win = searchWindow(e->xdestroywindow.window)) && win->getClientWindow() == e->xdestroywindow.window) {
|
||||||
if (win->destroyNotifyEvent(&e->xdestroywindow)) {
|
win->destroyNotifyEvent(e->xdestroywindow);
|
||||||
delete win;
|
removeWindowSearch(win->getClientWindow());
|
||||||
win = 0;
|
delete win;
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
#ifdef SLIT
|
#ifdef SLIT
|
||||||
else if ((slit = searchSlit(e->xdestroywindow.window))) {
|
else if ((slit = searchSlit(e->xdestroywindow.window))) {
|
||||||
|
@ -729,7 +720,7 @@ void Fluxbox::handleEvent(XEvent * const e) {
|
||||||
Tab *tab = 0;
|
Tab *tab = 0;
|
||||||
|
|
||||||
if ((win = searchWindow(e->xmotion.window)) !=0)
|
if ((win = searchWindow(e->xmotion.window)) !=0)
|
||||||
win->motionNotifyEvent(&e->xmotion);
|
win->motionNotifyEvent(e->xmotion);
|
||||||
else if ((tab = searchTab(e->xmotion.window)) !=0)
|
else if ((tab = searchTab(e->xmotion.window)) !=0)
|
||||||
tab->motionNotifyEvent(&e->xmotion);
|
tab->motionNotifyEvent(&e->xmotion);
|
||||||
|
|
||||||
|
@ -829,7 +820,7 @@ void Fluxbox::handleEvent(XEvent * const e) {
|
||||||
Tab *tab = 0;
|
Tab *tab = 0;
|
||||||
|
|
||||||
if ((win = searchWindow(e->xexpose.window)))
|
if ((win = searchWindow(e->xexpose.window)))
|
||||||
win->exposeEvent(&e->xexpose);
|
win->exposeEvent(e->xexpose);
|
||||||
else if ((tab = searchTab(e->xexpose.window)))
|
else if ((tab = searchTab(e->xexpose.window)))
|
||||||
tab->exposeEvent(&e->xexpose);
|
tab->exposeEvent(&e->xexpose);
|
||||||
}
|
}
|
||||||
|
@ -891,7 +882,7 @@ void Fluxbox::handleButtonEvent(XButtonEvent &be) {
|
||||||
|
|
||||||
if ((win = searchWindow(be.window))) {
|
if ((win = searchWindow(be.window))) {
|
||||||
|
|
||||||
win->buttonPressEvent(&be);
|
win->buttonPressEvent(be);
|
||||||
|
|
||||||
if (be.button == 1)
|
if (be.button == 1)
|
||||||
win->installColormap(True);
|
win->installColormap(True);
|
||||||
|
@ -997,7 +988,7 @@ void Fluxbox::handleButtonEvent(XButtonEvent &be) {
|
||||||
Tab *tab = 0;
|
Tab *tab = 0;
|
||||||
|
|
||||||
if ((win = searchWindow(be.window)))
|
if ((win = searchWindow(be.window)))
|
||||||
win->buttonReleaseEvent(&be);
|
win->buttonReleaseEvent(be);
|
||||||
else if ((tab = searchTab(be.window)))
|
else if ((tab = searchTab(be.window)))
|
||||||
tab->buttonReleaseEvent(&be);
|
tab->buttonReleaseEvent(&be);
|
||||||
}
|
}
|
||||||
|
@ -1022,10 +1013,12 @@ void Fluxbox::handleUnmapNotify(XUnmapEvent &ue) {
|
||||||
|
|
||||||
if ((win = searchWindow(ue.window)) != 0) {
|
if ((win = searchWindow(ue.window)) != 0) {
|
||||||
|
|
||||||
if (win->unmapNotifyEvent(&ue)) {
|
win->unmapNotifyEvent(ue);
|
||||||
delete win;
|
if (win->getClientWindow() == ue.window) {
|
||||||
if (focused_window == win) // some extra checking
|
if (win == focused_window)
|
||||||
focused_window = 0;
|
focused_window = 0;
|
||||||
|
removeWindowSearch(win->getClientWindow());
|
||||||
|
delete win;
|
||||||
win = 0;
|
win = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1091,7 +1084,7 @@ void Fluxbox::handleClientMessage(XClientMessageEvent &ce) {
|
||||||
net.workspace = ce.data.l[2];
|
net.workspace = ce.data.l[2];
|
||||||
net.stack = ce.data.l[3];
|
net.stack = ce.data.l[3];
|
||||||
net.decoration = static_cast<int>(ce.data.l[4]);
|
net.decoration = static_cast<int>(ce.data.l[4]);
|
||||||
win->changeBlackboxHints(&net);
|
win->changeBlackboxHints(net);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
FluxboxWindow *win = searchWindow(ce.window);
|
FluxboxWindow *win = searchWindow(ce.window);
|
||||||
|
@ -1391,66 +1384,66 @@ void Fluxbox::doWindowAction(Keys::KeyAction action, const int param) {
|
||||||
focused_window->getTab()->shade();
|
focused_window->getTab()->shade();
|
||||||
break;
|
break;
|
||||||
case Keys::MAXIMIZE:
|
case Keys::MAXIMIZE:
|
||||||
focused_window->maximize(0);
|
focused_window->maximize();
|
||||||
break;
|
break;
|
||||||
case Keys::STICK:
|
case Keys::STICK:
|
||||||
focused_window->stick();
|
focused_window->stick();
|
||||||
break;
|
break;
|
||||||
case Keys::VERTMAX:
|
case Keys::VERTMAX:
|
||||||
if (focused_window->isResizable())
|
if (focused_window->isResizable())
|
||||||
focused_window->maximize(2); // maximize vertically, done with mouse2
|
focused_window->maximizeVertical();
|
||||||
break;
|
break;
|
||||||
case Keys::HORIZMAX:
|
case Keys::HORIZMAX:
|
||||||
if (focused_window->isResizable())
|
if (focused_window->isResizable())
|
||||||
focused_window->maximize(3); // maximize horisontally, done with mouse3
|
focused_window->maximizeHorizontal();
|
||||||
break;
|
break;
|
||||||
case Keys::NUDGERIGHT:
|
case Keys::NUDGERIGHT:
|
||||||
focused_window->configure(
|
focused_window->moveResize(
|
||||||
focused_window->getXFrame()+param, focused_window->getYFrame(),
|
focused_window->getXFrame()+param, focused_window->getYFrame(),
|
||||||
focused_window->getWidth(), focused_window->getHeight());
|
focused_window->getWidth(), focused_window->getHeight());
|
||||||
break;
|
break;
|
||||||
case Keys::NUDGELEFT:
|
case Keys::NUDGELEFT:
|
||||||
focused_window->configure(
|
focused_window->moveResize(
|
||||||
focused_window->getXFrame()-param, focused_window->getYFrame(),
|
focused_window->getXFrame()-param, focused_window->getYFrame(),
|
||||||
focused_window->getWidth(), focused_window->getHeight());
|
focused_window->getWidth(), focused_window->getHeight());
|
||||||
break;
|
break;
|
||||||
case Keys::NUDGEUP:
|
case Keys::NUDGEUP:
|
||||||
focused_window->configure(
|
focused_window->moveResize(
|
||||||
focused_window->getXFrame(), focused_window->getYFrame()-param,
|
focused_window->getXFrame(), focused_window->getYFrame()-param,
|
||||||
focused_window->getWidth(), focused_window->getHeight());
|
focused_window->getWidth(), focused_window->getHeight());
|
||||||
break;
|
break;
|
||||||
case Keys::NUDGEDOWN:
|
case Keys::NUDGEDOWN:
|
||||||
focused_window->configure(
|
focused_window->moveResize(
|
||||||
focused_window->getXFrame(), focused_window->getYFrame()+param,
|
focused_window->getXFrame(), focused_window->getYFrame()+param,
|
||||||
focused_window->getWidth(), focused_window->getHeight());
|
focused_window->getWidth(), focused_window->getHeight());
|
||||||
break;
|
break;
|
||||||
// NOTE !!! BIGNUDGExxxx is not needed, just use 10 as a parameter
|
// NOTE !!! BIGNUDGExxxx is not needed, just use 10 as a parameter
|
||||||
case Keys::BIGNUDGERIGHT:
|
case Keys::BIGNUDGERIGHT:
|
||||||
focused_window->configure(
|
focused_window->moveResize(
|
||||||
focused_window->getXFrame()+10, focused_window->getYFrame(),
|
focused_window->getXFrame()+10, focused_window->getYFrame(),
|
||||||
focused_window->getWidth(), focused_window->getHeight());
|
focused_window->getWidth(), focused_window->getHeight());
|
||||||
break;
|
break;
|
||||||
case Keys::BIGNUDGELEFT:
|
case Keys::BIGNUDGELEFT:
|
||||||
focused_window->configure(
|
focused_window->moveResize(
|
||||||
focused_window->getXFrame()-10, focused_window->getYFrame(),
|
focused_window->getXFrame()-10, focused_window->getYFrame(),
|
||||||
focused_window->getWidth(), focused_window->getHeight());
|
focused_window->getWidth(), focused_window->getHeight());
|
||||||
break;
|
break;
|
||||||
case Keys::BIGNUDGEUP:
|
case Keys::BIGNUDGEUP:
|
||||||
focused_window->configure(
|
focused_window->moveResize(
|
||||||
focused_window->getXFrame(), focused_window->getYFrame()-10,
|
focused_window->getXFrame(), focused_window->getYFrame()-10,
|
||||||
focused_window->getWidth(), focused_window->getHeight());
|
focused_window->getWidth(), focused_window->getHeight());
|
||||||
break;
|
break;
|
||||||
case Keys::BIGNUDGEDOWN:
|
case Keys::BIGNUDGEDOWN:
|
||||||
focused_window->configure(
|
focused_window->moveResize(
|
||||||
focused_window->getXFrame(), focused_window->getYFrame()+10,
|
focused_window->getXFrame(), focused_window->getYFrame()+10,
|
||||||
focused_window->getWidth(), focused_window->getHeight());
|
focused_window->getWidth(), focused_window->getHeight());
|
||||||
break;
|
break;
|
||||||
case Keys::HORIZINC:
|
case Keys::HORIZINC:
|
||||||
if (focused_window->isResizable())
|
focused_window->moveResize(
|
||||||
focused_window->configure(
|
|
||||||
focused_window->getXFrame(), focused_window->getYFrame(),
|
focused_window->getXFrame(), focused_window->getYFrame(),
|
||||||
focused_window->getWidth()+10, focused_window->getHeight());
|
focused_window->getWidth()+10, focused_window->getHeight());
|
||||||
|
|
||||||
|
|
||||||
if (focused_window->hasTab() &&
|
if (focused_window->hasTab() &&
|
||||||
(t_placement == Tab::PTOP || t_placement == Tab::PBOTTOM)) {
|
(t_placement == Tab::PTOP || t_placement == Tab::PBOTTOM)) {
|
||||||
if (t_alignment == Tab::ARELATIVE)
|
if (t_alignment == Tab::ARELATIVE)
|
||||||
|
@ -1460,8 +1453,7 @@ void Fluxbox::doWindowAction(Keys::KeyAction action, const int param) {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case Keys::VERTINC:
|
case Keys::VERTINC:
|
||||||
if (focused_window->isResizable())
|
focused_window->moveResize(
|
||||||
focused_window->configure(
|
|
||||||
focused_window->getXFrame(), focused_window->getYFrame(),
|
focused_window->getXFrame(), focused_window->getYFrame(),
|
||||||
focused_window->getWidth(), focused_window->getHeight()+10);
|
focused_window->getWidth(), focused_window->getHeight()+10);
|
||||||
|
|
||||||
|
@ -1474,8 +1466,7 @@ void Fluxbox::doWindowAction(Keys::KeyAction action, const int param) {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case Keys::HORIZDEC:
|
case Keys::HORIZDEC:
|
||||||
if (focused_window->isResizable())
|
focused_window->moveResize(
|
||||||
focused_window->configure(
|
|
||||||
focused_window->getXFrame(), focused_window->getYFrame(),
|
focused_window->getXFrame(), focused_window->getYFrame(),
|
||||||
focused_window->getWidth()-10, focused_window->getHeight());
|
focused_window->getWidth()-10, focused_window->getHeight());
|
||||||
|
|
||||||
|
@ -1488,8 +1479,7 @@ void Fluxbox::doWindowAction(Keys::KeyAction action, const int param) {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case Keys::VERTDEC:
|
case Keys::VERTDEC:
|
||||||
if (focused_window->isResizable())
|
focused_window->moveResize(
|
||||||
focused_window->configure(
|
|
||||||
focused_window->getXFrame(), focused_window->getYFrame(),
|
focused_window->getXFrame(), focused_window->getYFrame(),
|
||||||
focused_window->getWidth(), focused_window->getHeight()-10);
|
focused_window->getWidth(), focused_window->getHeight()-10);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue