Commit 3244ba9678b0fa9df3aed7d1ee3eb77f015c5a6b

Authored by Marius Hanne
1 parent 962ae0696c

simplify EM/Gtk integration (thanks lian!)

Showing 1 changed file with 2 additions and 9 deletions Side-by-side Diff

lib/bitcoin/gui/em_gtk.rb
... ... @@ -11,7 +11,7 @@
11 11 def Gtk.main_iteration_with_queue
12 12 GTK_PENDING_BLOCKS_LOCK.synchronize do
13 13 for block in GTK_PENDING_BLOCKS
14   - EM.next_tick { block.call }
  14 + block.call
15 15 end
16 16 GTK_PENDING_BLOCKS.clear
17 17 end
... ... @@ -21,14 +21,7 @@
21 21  
22 22 module EM
23 23 def self.gtk_main
24   - give_tick = proc do
25   - Gtk.main_iteration_with_queue
26   - EM.defer do
27   - sleep 0.001
28   - EM.next_tick give_tick
29   - end
30   - end
31   - give_tick.call
  24 + EM.add_periodic_timer(0.001) { Gtk.main_iteration_with_queue }
32 25 end
33 26 end