aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2003-07-01 20:29:44 (GMT)
committerfluxgen <fluxgen>2003-07-01 20:29:44 (GMT)
commitb54dbfb7b14fe3c4346465bd9287ac1bf9935133 (patch)
treed6a8cbe0986784ac2e70382343ed4981a9be4c9e
parent0409604f3ad30016217a66c251dfab1f4a7ecb97 (diff)
downloadfluxbox-b54dbfb7b14fe3c4346465bd9287ac1bf9935133.zip
fluxbox-b54dbfb7b14fe3c4346465bd9287ac1bf9935133.tar.bz2
handle focus out event to revert focus to fluxboxwindow if a menu isnt focused
-rw-r--r--src/fluxbox.cc20
1 files 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 @@
22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23// DEALINGS IN THE SOFTWARE. 23// DEALINGS IN THE SOFTWARE.
24 24
25// $Id: fluxbox.cc,v 1.166 2003/06/30 20:36:57 fluxgen Exp $ 25// $Id: fluxbox.cc,v 1.167 2003/07/01 20:29:44 fluxgen Exp $
26 26
27#include "fluxbox.hh" 27#include "fluxbox.hh"
28 28
@@ -877,6 +877,7 @@ void Fluxbox::handleEvent(XEvent * const e) {
877 } 877 }
878 } break; 878 } break;
879 case FocusIn: { 879 case FocusIn: {
880
880 if (e->xfocus.mode == NotifyUngrab || 881 if (e->xfocus.mode == NotifyUngrab ||
881 e->xfocus.detail == NotifyPointer) 882 e->xfocus.detail == NotifyPointer)
882 break; 883 break;
@@ -886,7 +887,22 @@ void Fluxbox::handleEvent(XEvent * const e) {
886 setFocusedWindow(win); 887 setFocusedWindow(win);
887 888
888 } break; 889 } break;
889 case FocusOut: 890 case FocusOut:{
891#ifdef DEBUG
892 cerr<<__FILE__<<"("<<__FUNCTION__<<") Focus out!"<<endl;
893#endif // DEBUG
894 if (e->xfocus.mode == NotifyUngrab ||
895 e->xfocus.detail == NotifyPointer)
896 break;
897 FluxboxWindow *win = searchWindow(e->xfocus.window);
898 if (win == 0 && FbTk::Menu::focused() == 0) {
899#ifdef DEBUG
900 cerr<<__FILE__<<"("<<__FUNCTION__<<") Focus out is not a FluxboxWindow !!"<<endl;
901#endif // DEBUG
902 if (getFocusedWindow())
903 getFocusedWindow()->setInputFocus();
904 }
905 }
890 break; 906 break;
891 case ClientMessage: 907 case ClientMessage:
892 handleClientMessage(e->xclient); 908 handleClientMessage(e->xclient);