all repos — fluxbox @ b54dbfb7b14fe3c4346465bd9287ac1bf9935133

custom fork of the fluxbox windowmanager

handle focus out event to revert focus to fluxboxwindow if a menu isnt focused
fluxgen fluxgen
commit

b54dbfb7b14fe3c4346465bd9287ac1bf9935133

parent

0409604f3ad30016217a66c251dfab1f4a7ecb97

1 files changed, 18 insertions(+), 2 deletions(-)

jump to
M src/fluxbox.ccsrc/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);