handle focus out event to revert focus to fluxboxwindow if a menu isnt focused
fluxgen fluxgen
1 files changed,
18 insertions(+),
2 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.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 @@ ColormapInstalled) ? true : false);
} } break; case FocusIn: { + if (e->xfocus.mode == NotifyUngrab || e->xfocus.detail == NotifyPointer) break;@@ -886,7 +887,22 @@ if (win && ! win->isFocused())
setFocusedWindow(win); } break; - case FocusOut: + case FocusOut:{ +#ifdef DEBUG + cerr<<__FILE__<<"("<<__FUNCTION__<<") Focus out!"<<endl; +#endif // DEBUG + if (e->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 !!"<<endl; +#endif // DEBUG + if (getFocusedWindow()) + getFocusedWindow()->setInputFocus(); + } + } break; case ClientMessage: handleClientMessage(e->xclient);