From 5590928168f6466a919b05b89ab06ec897e6405f Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 10 Dec 2011 05:21:00 +0000 Subject: Fix event handling. git-svn-id: http://svn.drobilla.net/lad/trunk/patchage@3852 a436a847-0d15-0410-975c-d299462d15a1 --- src/PatchageModule.cpp | 11 +++++++---- src/PatchageModule.hpp | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/PatchageModule.cpp b/src/PatchageModule.cpp index a78ee57..066ff47 100644 --- a/src/PatchageModule.cpp +++ b/src/PatchageModule.cpp @@ -27,7 +27,10 @@ PatchageModule::PatchageModule( , _name(name) , _type(type) { - signal_moved.connect( + signal_event().connect( + sigc::mem_fun(this, &PatchageModule::on_event)); + + signal_moved().connect( sigc::mem_fun(this, &PatchageModule::store_location)); } @@ -87,10 +90,10 @@ PatchageModule::show_menu(GdkEventButton* ev) } bool -PatchageModule::on_click(GdkEventButton* ev) +PatchageModule::on_event(GdkEvent* ev) { - if (ev->button == 3) { - return show_menu(ev); + if (ev->type == GDK_BUTTON_PRESS && ev->button.button == 3) { + return show_menu(&ev->button); } return false; } diff --git a/src/PatchageModule.hpp b/src/PatchageModule.hpp index 8b7e3ef..401a366 100644 --- a/src/PatchageModule.hpp +++ b/src/PatchageModule.hpp @@ -55,7 +55,7 @@ public: ModuleType type() const { return _type; } protected: - bool on_click(GdkEventButton* ev); + bool on_event(GdkEvent* ev); void add_port(Ganv::Port* port); void remove_port(Ganv::Port* port); -- cgit v1.2.1