From 117e22670d08fb4b865ebe84fa779ae1acb16b1d Mon Sep 17 00:00:00 2001 From: Michael R Sweet Date: Sun, 29 Oct 2006 17:11:10 +0000 Subject: Another try at the shortcut fix... git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@5534 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl.cxx | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/Fl.cxx b/src/Fl.cxx index ec0196b52..15a7049ad 100644 --- a/src/Fl.cxx +++ b/src/Fl.cxx @@ -106,7 +106,6 @@ int Fl::event_inside(int xx,int yy,int ww,int hh) /*const*/ { } int Fl::event_inside(const Fl_Widget *o) /*const*/ { - if (first_window() != o->window()) return 0; int mx = e_x - o->x(); int my = e_y - o->y(); return (mx >= 0 && mx < o->w() && my >= 0 && my < o->h()); @@ -796,8 +795,7 @@ int Fl::handle(int e, Fl_Window* window) if (send(FL_KEYBOARD, wi, window)) return 1; // recursive call to try shortcut: - if (handle(FL_SHORTCUT, first_window())) return 1; - else if (first_window() != window && handle(FL_SHORTCUT, window)) return 1; + if (handle(FL_SHORTCUT, window)) return 1; // and then try a shortcut with the case of the text swapped, by // changing the text and falling through to FL_SHORTCUT case: @@ -809,15 +807,15 @@ int Fl::handle(int e, Fl_Window* window) case FL_SHORTCUT: if (grab()) {wi = grab(); break;} // send it to grab window - // Try it as shortcut, sending to focused window then mouse widget and - // all parents: - if (send(FL_SHORTCUT, first_window(), first_window())) return 1; - + // Try it as shortcut, sending to mouse widget and all parents: wi = belowmouse(); if (!wi) { wi = modal(); if (!wi) wi = window; + } else if (wi->window() != first_window()) { + if (send(FL_SHORTCUT, first_window(), first_window())) return 1; } + for (; wi; wi = wi->parent()) { if (send(FL_SHORTCUT, wi, wi->window())) return 1; } -- cgit v1.2.3