minor style cleaning and extra checking in unmapNotifyEvent
fluxgen fluxgen
1 files changed,
38 insertions(+),
42 deletions(-)
jump to
M
src/fluxbox.cc
→
src/fluxbox.cc
@@ -22,7 +22,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: fluxbox.cc,v 1.68 2002/08/14 23:03:07 fluxgen Exp $ +// $Id: fluxbox.cc,v 1.69 2002/08/16 11:09:25 fluxgen Exp $ #include "fluxbox.hh"@@ -581,7 +581,7 @@ }
break; case MapRequest: { -#ifdef DEBUG +#ifdef DEBUG fprintf(stderr, I18n::instance()-> getMessage(@@ -651,7 +651,7 @@ break;
case MapNotify: { FluxboxWindow *win = searchWindow(e->xmap.window); - if (win!=0) + if (win != 0) win->mapNotifyEvent(&e->xmap); }@@ -659,33 +659,34 @@ break;
case UnmapNotify: - handleUnmapNotify(e->xunmap); + handleUnmapNotify(e->xunmap); break; case CreateNotify: - break; - case DestroyNotify: - { + break; + case DestroyNotify: { FluxboxWindow *win = (FluxboxWindow *) 0; - #ifdef SLIT +#ifdef SLIT Slit *slit = 0; - #endif // SLIT +#endif // SLIT if ((win = searchWindow(e->xdestroywindow.window))) { if (win->destroyNotifyEvent(&e->xdestroywindow)) { delete win; win = 0; } - #ifdef SLIT - } else if ((slit = searchSlit(e->xdestroywindow.window))) { - slit->removeClient(e->xdestroywindow.window, False); - #endif // SLIT + + } +#ifdef SLIT + else if ((slit = searchSlit(e->xdestroywindow.window))) { + slit->removeClient(e->xdestroywindow.window, false); + } +#endif // SLIT } break; - case MotionNotify: - { + case MotionNotify: { last_time = e->xmotion.time; FluxboxWindow *win = 0;@@ -702,8 +703,7 @@
} break; - case PropertyNotify: - { + case PropertyNotify: { last_time = e->xproperty.time;@@ -716,8 +716,7 @@ }
} break; - case EnterNotify: - { + case EnterNotify: { last_time = e->xcrossing.time; BScreen *screen = (BScreen *) 0;@@ -774,7 +773,7 @@ ungrab();
} } -#ifdef SLIT +#ifdef SLIT else if ((slit = searchSlit(e->xcrossing.window))) slit->enterNotifyEvent(&e->xcrossing); #endif // SLIT@@ -829,19 +828,16 @@ break;
case KeyPress: handleKeyEvent(e->xkey); break; - case ColormapNotify: - { + case ColormapNotify: { BScreen *screen = searchScreen(e->xcolormap.window); - if (screen) - screen->setRootColormapInstalled((e->xcolormap.state == + if (screen != 0) { + screen->setRootColormapInstalled((e->xcolormap.state == ColormapInstalled) ? True : False); - - + } } break; - case FocusIn: - { + case FocusIn: { if (e->xfocus.mode == NotifyUngrab || e->xfocus.detail == NotifyPointer) break;@@ -850,16 +846,13 @@ FluxboxWindow *win = searchWindow(e->xfocus.window);
if (win && ! win->isFocused()) setFocusedWindow(win); - } - break; + } break; case FocusOut: break; - case ClientMessage: handleClientMessage(e->xclient); break; - default: - { + default: { #ifdef SHAPE if (e->type == getShapeEventBase()) {@@ -1026,28 +1019,29 @@
FluxboxWindow *win = 0; - #ifdef SLIT +#ifdef SLIT Slit *slit = (Slit *) 0; - #endif // SLIT +#endif // SLIT BScreen *screen = searchScreen(ue.event); if ( (ue.event != ue.window) && (screen != 0 || !ue.send_event)) return; - if ( (win = searchWindow(ue.window)) !=0 ) { + if ((win = searchWindow(ue.window)) != 0) { - if (win->unmapNotifyEvent(&ue)) + if (win->unmapNotifyEvent(&ue)) { delete win; + if (focused_window == win) // some extra checking + focused_window = 0; + win = 0; + } } - #ifdef SLIT +#ifdef SLIT else if ((slit = searchSlit(ue.window))!=0) { slit->removeClient(ue.window); - #ifdef DEBUG - cerr<<__FILE__<<"("<<__LINE__<<"): Here"<<endl; - #endif } - #endif // SLIT +#endif // SLIT }@@ -1594,6 +1588,8 @@ case SIGUSR2:
rereadMenu(); break; case SIGSEGV: + abort(); + break; case SIGFPE: case SIGINT: case SIGTERM: