From b54dbfb7b14fe3c4346465bd9287ac1bf9935133 Mon Sep 17 00:00:00 2001 From: fluxgen Date: Tue, 1 Jul 2003 20:29:44 +0000 Subject: handle focus out event to revert focus to fluxboxwindow if a menu isnt focused --- src/fluxbox.cc | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/fluxbox.cc b/src/fluxbox.cc index c6771ec..7f76e46 100644 --- a/src/fluxbox.cc +++ b/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.166 2003/06/30 20:36:57 fluxgen Exp $ +// $Id: fluxbox.cc,v 1.167 2003/07/01 20:29:44 fluxgen Exp $ #include "fluxbox.hh" @@ -877,6 +877,7 @@ void Fluxbox::handleEvent(XEvent * const e) { } } break; case FocusIn: { + if (e->xfocus.mode == NotifyUngrab || e->xfocus.detail == NotifyPointer) break; @@ -886,7 +887,22 @@ void Fluxbox::handleEvent(XEvent * const e) { setFocusedWindow(win); } break; - case FocusOut: + case FocusOut:{ +#ifdef DEBUG + cerr<<__FILE__<<"("<<__FUNCTION__<<") Focus out!"<xfocus.mode == NotifyUngrab || + e->xfocus.detail == NotifyPointer) + break; + FluxboxWindow *win = searchWindow(e->xfocus.window); + if (win == 0 && FbTk::Menu::focused() == 0) { +#ifdef DEBUG + cerr<<__FILE__<<"("<<__FUNCTION__<<") Focus out is not a FluxboxWindow !!"<setInputFocus(); + } + } break; case ClientMessage: handleClientMessage(e->xclient); -- cgit v0.11.2