Popup the menu in the button_press_event handler.
authorTilman Sauerbeck <tilman@code-monkey.de>
Sun, 12 Mar 2006 18:55:00 +0000 (18:55 +0000)
committerTilman Sauerbeck <tilman@code-monkey.de>
Sun, 12 Mar 2006 19:55:00 +0000 (19:55 +0000)
bin/snett

index 1dce708..96d6c01 100755 (executable)
--- a/bin/snett
+++ b/bin/snett
@@ -99,15 +99,12 @@ module Snett
                        event_box.events = Gdk::Event::BUTTON_PRESS_MASK |
                                           Gdk::Event::BUTTON_RELEASE_MASK
 
-                       event_box.signal_connect("button_release_event") do |_, event|
-                               menu.popup(event) if event.button == 3
-                               false
-                       end
-
                        event_box.signal_connect("button_press_event") do |_, event|
                                if event.button == 1
                                        x, y = Gdk::Display.default.pointer[1, 2]
                                        self.begin_move_drag(event.button, x, y, event.time)
+                               elsif event.button == 3
+                                       menu.popup(event)
                                end
 
                                false