diff options
author | David Robillard <d@drobilla.net> | 2011-12-10 05:21:00 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2011-12-10 05:21:00 +0000 |
commit | 5590928168f6466a919b05b89ab06ec897e6405f (patch) | |
tree | 0cd872e18c83d72cb6f7945e9ff32286ddfe370e | |
parent | 19f833d75708fb6c6c32a8b48283331aa3607aeb (diff) | |
download | patchage-5590928168f6466a919b05b89ab06ec897e6405f.tar.gz patchage-5590928168f6466a919b05b89ab06ec897e6405f.tar.bz2 patchage-5590928168f6466a919b05b89ab06ec897e6405f.zip |
Fix event handling.
git-svn-id: http://svn.drobilla.net/lad/trunk/patchage@3852 a436a847-0d15-0410-975c-d299462d15a1
-rw-r--r-- | src/PatchageModule.cpp | 11 | ||||
-rw-r--r-- | src/PatchageModule.hpp | 2 |
2 files changed, 8 insertions, 5 deletions
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); |