summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMatthias Melcher <fltk@matthiasm.com>2008-02-20 18:33:25 +0000
committerMatthias Melcher <fltk@matthiasm.com>2008-02-20 18:33:25 +0000
commitf33d7c846eedd11a2c7150a900929111f1d08f20 (patch)
tree4604ac800207342d7673588ccfa1bf5c004607e8 /src
parent272b19ff34f1dd55971ebe1af0ae1f49ebf66356 (diff)
STR 1869: fixed race condition when an alert window pops up during menu handling.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@6035 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src')
-rw-r--r--src/fl_ask.cxx6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/fl_ask.cxx b/src/fl_ask.cxx
index 0f9abcbb5..753fc72c0 100644
--- a/src/fl_ask.cxx
+++ b/src/fl_ask.cxx
@@ -208,6 +208,10 @@ static int innards(const char* fmt, va_list ap,
button[0]->shortcut(FL_Escape);
message_form->show();
+ // deactivate Fl::grab(), because it is incompatible with Fl::readqueue()
+ Fl_Window* g = Fl::grab();
+ if (g) // do an alternative grab to avoid floating menus, if possible
+ Fl::grab(message_form);
int r;
for (;;) {
Fl_Widget *o = Fl::readqueue();
@@ -217,6 +221,8 @@ static int innards(const char* fmt, va_list ap,
else if (o == button[2]) {r = 2; break;}
else if (o == message_form) {r = 0; break;}
}
+ if (g) // regrab the previous popup menu, if there was one
+ Fl::grab(g);
message_form->hide();
icon->label(prev_icon_label);
return r;