# HG changeset patch # User Michael Goffioul # Date 1322240959 0 # Node ID e48e8253ce58603d611402df8407623e282f174a # Parent 7a756a7e145b7adf3bf48333c50abe07010b07b9 Re-allow recursive graphics event processing. * src/graphics.cc (gh_manager::do_process_events): Re-allow recursivity. diff -r 7a756a7e145b -r e48e8253ce58 src/graphics.cc --- a/src/graphics.cc Fri Nov 25 11:29:31 2011 -0500 +++ b/src/graphics.cc Fri Nov 25 17:09:19 2011 +0000 @@ -7792,63 +7792,60 @@ { graphics_event e; bool old_Vdrawnow_requested = Vdrawnow_requested; - unwind_protect frame; - - static int process_events_executing = 0; - - frame.protect_var (process_events_executing); - - if (++process_events_executing <= 1) - { - do - { - e = graphics_event (); - - gh_manager::lock (); - - if (! event_queue.empty ()) + bool events_executed = false; + + do + { + e = graphics_event (); + + gh_manager::lock (); + + if (! event_queue.empty ()) + { + if (callback_objects.empty () || force) { - if (callback_objects.empty () || force) + e = event_queue.front (); + + event_queue.pop_front (); + } + else + { + const graphics_object& go = callback_objects.front (); + + if (go.get_properties ().is_interruptible ()) { e = event_queue.front (); event_queue.pop_front (); } - else - { - const graphics_object& go = callback_objects.front (); - - if (go.get_properties ().is_interruptible ()) - { - e = event_queue.front (); - - event_queue.pop_front (); - } - } } - - gh_manager::unlock (); - - if (e.ok ()) - e.execute (); - } - while (e.ok ()); - - gh_manager::lock (); - - if (event_queue.empty () && event_processing == 0) - command_editor::remove_event_hook (gh_manager::process_events); + } gh_manager::unlock (); - flush_octave_stdout (); - - if (Vdrawnow_requested && ! old_Vdrawnow_requested) - { - feval ("drawnow"); - - Vdrawnow_requested = false; - } + if (e.ok ()) + { + e.execute (); + events_executed = true; + } + } + while (e.ok ()); + + gh_manager::lock (); + + if (event_queue.empty () && event_processing == 0) + command_editor::remove_event_hook (gh_manager::process_events); + + gh_manager::unlock (); + + if (events_executed) + flush_octave_stdout (); + + if (Vdrawnow_requested && ! old_Vdrawnow_requested) + { + feval ("drawnow"); + + Vdrawnow_requested = false; } return 0;