Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm using a custom Touchégg multitouch gesture setup in Ubuntu 11.04 with a Magic Trackpad. Since the default gestures (such as 3-finger tap and drag to move windows, 4 finger tap to reveal the dash, etc.) are apparently hardcoded in Unity, I'm unable to assign any custom Touchégg actions to them, and some default gestures (that I don't intend to use much, if at all) occasionally mix up with my similar custom-assigned ones and get triggered by accident.

Is there a practical way (short of tweaking the uTouch source) to disable some of the default gestures? If not, pointers to parts of the code (perhaps in grail?) where the default gestures are defined, and help with tweaking would also be appreciated.

share|improve this question
1  
Can you just uninstall utouch and keep touchégg? –  desgua Aug 21 '11 at 20:00
1  
Touchégg makes use of utouch-geis, so no, not in any remotely practical sense. –  mgunes Aug 23 '11 at 3:06
    
I suspect you can configure these actions in /etc/ginn/wishes.xml (I'm at mobile, can't test right now) –  desgua Aug 23 '11 at 10:56

4 Answers 4

An update to domster answer for Ubuntu 12.10.

Unity source code has obviously changed, so here is how to achieve the same in Unity 6.8.0. The steps to download Unity source code are the same as before (I will copy & paste domster's snippet):

sudo apt-get build-dep unity
cd /tmp  #It can be done somewhere else, feel free to change the base location.
mkdir unity
cd unity
apt-get source unity

At this point, the file to be edited is only /tmp/unity/unity-6.8.0/plugins/unityshell/src/unityshell.cpp.

Find the method UnityScreen::InitGesturesSupport() (line 3368 for Unity 6.8.0).

Then, comment all the lines starting with gesture_sub_launcher to make it look like:

void UnityScreen::InitGesturesSupport()
{
  std::unique_ptr<nux::GestureBroker> gesture_broker(new UnityGestureBroker);
  wt->GetWindowCompositor().SetGestureBroker(std::move(gesture_broker));
  /*
  gestures_sub_launcher_.reset(new nux::GesturesSubscription);
  gestures_sub_launcher_->SetGestureClasses(nux::DRAG_GESTURE);
  gestures_sub_launcher_->SetNumTouches(4);
  gestures_sub_launcher_->SetWindowId(GDK_ROOT_WINDOW());
  gestures_sub_launcher_->Activate();

  gestures_sub_dash_.reset(new nux::GesturesSubscription);
  gestures_sub_dash_->SetGestureClasses(nux::TAP_GESTURE);
  gestures_sub_dash_->SetNumTouches(4);
  gestures_sub_dash_->SetWindowId(GDK_ROOT_WINDOW());
  gestures_sub_dash_->Activate();

  gestures_sub_windows_.reset(new nux::GesturesSubscription);
  gestures_sub_windows_->SetGestureClasses(nux::TOUCH_GESTURE
                                         | nux::DRAG_GESTURE
                                         | nux::PINCH_GESTURE);
  gestures_sub_windows_->SetNumTouches(3);
  gestures_sub_windows_->SetWindowId(GDK_ROOT_WINDOW());
  gestures_sub_windows_->Activate();
  */
}

Re-build Unity following domster's instructions again:

cd /tmp/unity/unity-6.8.0
dpkg-buildpackage -us -uc -nc
cd ..
sudo dpkg -i *deb

Et voila again! Logout and log back in.

share|improve this answer
    
how would that work in current unity 7.2.1? –  plopp Jun 24 at 5:27
    
This answer is still 100% valid for Unity 7.2.2 (so I'm assuming it's also valid for 7.2.1). I'm building right now, will update on what happens re. touchegg once I'm done and rebooted. –  Endophage Aug 20 at 4:34

It turns out that it is not that hard to patch the unity package for totally disabling its handling of multi-touches and gestures. Here are step by step instructions for patching unity-4.24.0.

In a command line, enter:

sudo apt-get build-dep unity
cd /tmp  #It can be done somewhere else, feel free to change the base location.
mkdir unity
cd unity
apt-get source unity

At this point, comment out the following 2 lines in the file /tmp/unity/unity-4.24.0/plugins/unityshell/src/unityshell.cpp:

GeisAdapter::Default()->Run();
gestureEngine = new GestureEngine(screen);

and the following 4 lines in the file /tmp/unity/unity-4.24.0/plugins/unityshell/src/Launcher.cpp:

GeisAdapter& adapter = *(GeisAdapter::Default());
adapter.drag_start.connect(sigc::mem_fun(this, &Launcher::OnDragStart));
adapter.drag_update.connect(sigc::mem_fun(this, &Launcher::OnDragUpdate));
adapter.drag_finish.connect(sigc::mem_fun(this, &Launcher::OnDragFinish));

The source code is in C++, so commenting a line is done by adding // at the beginning of the line. For instance, the line

GeisAdapter::Default()->Run();

becomes

//GeisAdapter::Default()->Run(); .

Back to the command line, enter:

cd unity-4.24.0
dpkg-buildpackage -us -uc -nc
cd ..
sudo dpkg -i *deb

Et voila!

Now if you logout and log back in, gestures should function normally. Triple tap works on my system as a middle click by default, without a need for touchegg. But both touchegg and ginn now work well to define custom gestures for your applications.

share|improve this answer

To do this on latest unity (5.18.0) in 12.04 you have to comment-out slightly different code lines.

In plugins/unityshell/src/Launcher.cpp:

// GeisAdapter& adapter = GeisAdapter::Instance();
// adapter.drag_start.connect(sigc::mem_fun(this, &Launcher::OnDragStart));
// adapter.drag_update.connect(sigc::mem_fun(this, &Launcher::OnDragUpdate));
// adapter.drag_finish.connect(sigc::mem_fun(this, &Launcher::OnDragFinish));

In plugins/unityshell/src/unityshell.cpp:

// geis_adapter_.Run();
// gesture_engine_.reset(new GestureEngine(screen));
share|improve this answer

Second try

dinegri suggest that ' [t]o disable three gestures, it [is] necessary [to] have installed ccsm, [and then] disable "Unit MT Grab Handles" also know as "Loves Handles" ' here.

But it leaves us with the four finger gestures yet.

First try

The configuration file for utouch is /etc/ginn/wishes.xml. So you can edit this file and remove (or comment) the actions you don't want. Then Touchégg would do its job without conflicts.

Reference

PS: I couldn't reproduce your problem here to test the solution. I'm sorry for that.

share|improve this answer
    
That's the configuration file for ginn, which is a gesture injector, whose functionality overlaps with that of Touchégg. Modificiations to its configuration file would only have effect if the ginn daemon is running, which since I'm using Touchégg, it normally isn't. With the possibility of using ginn instead of Touchégg in mind, I've tried overriding some default Unity gestures by commenting them out in the ginn configuration file and running ginn, but that doesn't work. –  mgunes Aug 24 '11 at 1:15
    
I've updated the answer. –  desgua Aug 24 '11 at 16:38
4  
Disabling the handles plugin will only remove the visual affordance for dragging; it will not even disable the three finger tap and drag gesture (which I don't particularly want to disable anyway), let alone the others. –  mgunes Aug 24 '11 at 17:31
    
By the way, I already have it disabled, since due to bug #754000, I need to simulate the middle button click with Touchégg, and having the handles appear every time I perform a three finger tap is very disorienting. –  mgunes Aug 24 '11 at 17:36

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.