[saucy] scrolling with a touchpad is jerky with bindings set in compiz for Desktop-based Viewport Switching

Bug #1184159 reported by Matthieu Baerts on 2013-05-25
48
This bug affects 9 people
Affects Status Importance Assigned to Milestone
Compiz
Medium
Christopher Townsend
GTK+
Fix Released
Medium
X.Org X server
Confirmed
Medium
compiz (Ubuntu)
Medium
Christopher Townsend
gtk+3.0 (Ubuntu)
Low
Unassigned
xorg-server (Ubuntu)
Low
Unassigned

Bug Description

Hello,

Scrolling with a touchpad is now a bit jerky.

It's exactly the same bug than bug #1171156 introduced in Raring by an upstream's patch in order to fix bug #1046988 (which was tracked by upstream there: https://bugzilla.gnome.org/show_bug.cgi?id=690275 )

* Impact:
Up & down scrolling with a touchpad is now a bit jerky, seen best with gedit in large files though also seems to affect nautilus & in general.

* Testcase:
Set any bindings in Viewport Switcher > Desktop-based Viewport switching
try scrolling in long documents in gedit using a touchpad, is scrolling "jerky"?

* Videos:
Before: https://bugs.launchpad.net/ubuntu/+source/gtk+3.0/+bug/1171156/+attachment/3650661/+files/gtk_scroll_1171156_without_patch.ogv
After: https://bugs.launchpad.net/ubuntu/+source/gtk+3.0/+bug/1171156/+attachment/3650662/+files/gtk_scroll_1171156_with_patch.ogv

* Note:
It seems this bug doesn't affect Gnome-Shell session: https://bugs.launchpad.net/ubuntu/+source/gtk+3.0/+bug/1171156/comments/10

ProblemType: Bug
DistroRelease: Ubuntu 13.10
Package: libgtk-3-0 3.8.2-0ubuntu1
ProcVersionSignature: Ubuntu 3.9.0-2.7-generic 3.9.3
Uname: Linux 3.9.0-2-generic x86_64
ApportVersion: 2.10.2-0ubuntu1
Architecture: amd64
Date: Sat May 25 17:44:01 2013
InstallationDate: Installed on 2011-08-10 (653 days ago)
InstallationMedia: Ubuntu 11.10 "Oneiric Ocelot" - Alpha amd64 (20110803.1)
MarkForUpload: True
SourcePackage: gtk+3.0
UpgradeStatus: No upgrade log present (probably fresh install)

Related branches

Matthieu Baerts (matttbe) wrote :
Sebastien Bacher (seb128) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. The issue you are reporting is an upstream one and it would be nice if somebody having it could send the bug to the developers of the software by following the instructions at https://wiki.ubuntu.com/Bugs/Upstream/GNOME. If you have done so, please tell us the number of the upstream bug (or the link), so we can add a bugwatch that will inform us about its status. Thanks in advance.

Changed in gtk+3.0 (Ubuntu):
importance: Undecided → Low
Matthieu Baerts (matttbe) wrote :

@Sebastien: bugwatch added ;) => https://bugzilla.gnome.org/show_bug.cgi?id=699574

Sebastien Bacher (seb128) wrote :

Thanks

Changed in gtk+3.0 (Ubuntu):
status: New → Triaged
Changed in gtk:
importance: Unknown → Medium
status: Unknown → New
Doug McMahon (mc3man) wrote :

There would be no real reason to think this wouldn't affect a unity session as it did in 13.04, the only thing changed is the commit is now in 3.8 vs. a patch in 3.6 (reverted in 13.04

Actually seems to have gotten worse in a unity session as of late, see issue scrolling in gedit, nautilus (large folders), synaptic , maybe more.
Never could get the orig. issue that caused this commit to occur (Bug 1046988

Currently affected or not saucy users can test reverted gtk here, resolves all scrolling issues here in a unity session with no apparent ill effects
https://launchpad.net/~mc3man/+archive/test-scroll

Changed in gtk:
status: New → Confirmed
Doug McMahon (mc3man) wrote :

I've tried the patch attached in the upstream report & can say it is only a partial fix at best.
It does return some semblance of expected behavior but *only when one uses a 'glide' on the touchpad.* & only during the glide itself
(ie. push up or down & release from touchpad . It that case the start is bad but the glide is good.

Otherwise it's as bad or worse than current in a more normal scrolling activity where finger maintains contact or a short series of push ups or downs.

Not a suitable fix at all...

To refresh - Not a factor in gnome* sessions, only affected is an ubuntu/unity session
Most obvious apps are gedit on a text file of some size & in synaptic on a large package list, the default synaptic window certainly provides that.
As far as Evolution, don't know, don't use, but if it was affected in any DE from orig. commit then it likely would also benefit from reverting the commit if a better fix is not forthcoming.

Doug McMahon (mc3man) wrote :

To look at this a bit more I connected a usb wireless mouse to affected laptop & discovered that with the '0001-gdk-be-more-selective-resetting-scroll-events.patch' mentioned in upstream bug applied this bug would be created -
https://bugs.launchpad.net/ubuntu/+source/compiz/+bug/1200829
So not a good way to proceed.

Doug McMahon (mc3man) wrote :

The previous comment of mine is slightly flawed -
It seems here that the jerky scrolling in some windows is caused by the combination of the orig. xi2: Reset scroll valuators on synthesized crossing events commit which is in the current libgtk3 *&* bindings being set in compiz for Desktop-based Viewport Switching , specifically, - next = button 5, prev = button 4

If possible Matthieu could comment on whether he has these bindings set also.

If I disable the bindings then this bug & bug 1200829 go away
If I leave the bindings enabled & revert the xi2 ... commit thru the ppa packages then again both bugs go away

So from my perspective the bug(s) are in compiz

Matthieu Baerts (matttbe) wrote :

> It seems here that the jerky scrolling in some windows is caused by the combination
> of the orig. xi2: Reset scroll valuators on synthesized crossing events commit which
> is in the current libgtk3 *&* bindings being set in compiz for Desktop-based
> Viewport Switching , specifically, - next = button 5, prev = button 4

Yes, well done! I confirm that if I disable these bindings in Viewport Switcher, I no longer have this bug!
I don't know if this bug is due to Compiz (=> there is a bug with Evolution on Gnome bugzilla #699574) but I guess Compiz's devs will help us ;)

PS: Is it possible to post this comment on Gnome's Bugzilla? https://bugzilla.gnome.org/show_bug.cgi?id=699574

Doug McMahon (mc3man) on 2013-07-14
Changed in compiz:
status: New → Confirmed
Doug McMahon (mc3man) wrote :

Just to note - doesn't matter which bindings in the plugin are enabled, one could set the left/right or up/down, same deal, scrolling is affected

Doug McMahon (mc3man) on 2013-08-12
summary: - [saucy] scrolling with a touchpad is now a bit jerky
+ [saucy] scrolling with a touchpad is jerky with bindings set in compiz
+ for Desktop-based Viewport Switching
description: updated
Ubuntu QA Website (ubuntuqa) wrote :

This bug has been reported on the Ubuntu Package testing tracker.

A list of all reports related to this bug can be found here:
http://packages.qa.ubuntu.com/qatracker/reports/bugs/1184159

tags: added: package-qa-testing

I've been working on bug #1200829 and found a solution for that bug. My fix may also fix this issue as well. Could anyone affected by the issue in this bug please try my test package at ppa:townsend/gtk-testing and let me know?

Thanks!

Matthieu Baerts (matttbe) wrote :

Hello Christopher,

Yes, I confirm that resetting scroll valuators for only slave devices fixes this problem! :-)

I have submitted the patch upstream. If/when that gets accepted, I'll work with the Distro team on getting it into 13.10 as an SRU.

Changed in compiz:
status: Confirmed → Invalid
Changed in gtk+3.0 (Ubuntu):
status: Triaged → In Progress
assignee: nobody → Christopher Townsend (townsend)

Update: My patch was essentially rejected in that it pretty much accomplishes reverting the fix for bug #1046988. I chatted with an Ubuntu dev about this issue and he was of the opinion that a fix is needed that doesn't revert the original fix and also fixes this issue. I don't disagree, but it doesn't seem upstream Gtk+ is motivated to fix it and I'm not sure how to fix it, so it looks like we are stuck for now:(

Changed in gtk:
status: Confirmed → Fix Released
Doug McMahon (mc3man) wrote :

upstream commit (4168c3cab9cb17bb4c75bd2f60c13c149afbf29c) doesn't fix here, at least with 3.8.6

Matthieu Baerts (matttbe) wrote :

@Doug: thank you for this test!
Is it maybe possible to answer to this question from Carlos Garnacho on Gnome's bugzilla[1]?

> I hence closing this bug, I also pushed
> https://git.gnome.org/browse/gtk+/commit/?id=962415aeb7e9e47f61c006a5d817a15d181c5055
> , so if anyone steps on this bug again (or thinks so), the output of an
> affected application with GDK_DEBUG=events will be really handy

[1] https://bugzilla.gnome.org/show_bug.cgi?id=699574#c27

On 11/17/2013 04:37 AM, Matthieu Baerts wrote:
> @Doug: thank you for this test!
> Is it maybe possible to answer to this question from Carlos Garnacho on Gnome's bugzilla[1]?
>
>> I hence closing this bug, I also pushed
>> https://git.gnome.org/browse/gtk+/commit/?id=962415aeb7e9e47f61c006a5d817a15d181c5055
>> , so if anyone steps on this bug again (or thinks so), the output of an
>> affected application with GDK_DEBUG=events will be really handy
> [1] https://bugzilla.gnome.org/show_bug.cgi?id=699574#c27
>
Honestly I have no clue as how to produce something from that debug code
with compiz
(did include it in the gtk build..

Matthieu Baerts (matttbe) wrote :

After having patched GTK with the commit 962415a, I guess you can relaunch Compiz with this command:

    $ env GDK_DEBUG=events compiz --replace

(I didn't test it)

Compiz isn't a Gtk app, so there is no need to run it with GDK_DEBUG=events. It's the Gtk app that needs to be ran with that environment setting as this is a Gtk issue and not a Compiz issue. The same issue also occurs when a Gtk app is unfocused and you try to scroll in the unfocused window (see bug #1240957).

I've provided upstream with some more debug output and a better repro case. Hopefully they will stay on this and try to fix it for all cases.

If a client (normally a reparenting WM) sets a passive button grab and it is triggered when the pointer is above another client's window (eg. a WM-managed window), crossing events will be rightfully generated, however XI2 crossing events in the second client don't contain the expected mode, XINotifyPassiveGrab/Ungrab would be appropriate here, but XINotifyGrab/Ungrab are used instead.

Changed in xorg-server (Ubuntu):
status: New → Triaged
importance: Undecided → Low

I'm removing myself as the Gtk+ assignee since my proposed patch is no good and upstream is also actively working on this. Also moving this back to the triaged state.

Changed in gtk+3.0 (Ubuntu):
status: In Progress → Triaged
assignee: Christopher Townsend (townsend) → nobody
Changed in xorg-server:
importance: Unknown → Medium
status: Unknown → Confirmed

Hi Carlos,

I tried these patches. Coupled with the Gtk+ fix, this does indeed fix the various scrolling issues! Hopefully the patches will be reviewed/accepted soon.

Thanks a million for addressing this!

Do you have a test case for this? I knocked up a simple one with two XI2 clients, one creating a window with enter/leave on a window, one with enter/leave on the button grab on the root window. Neither client gets an event and a printf in the server shows nothing is written onto the wire either (only the button event to activate the grab).

If I change to an active grab + ungrab, I get the events correctly.

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gtk+3.0 - 3.10.6-0ubuntu2

---------------
gtk+3.0 (3.10.6-0ubuntu2) trusty; urgency=low

  * debian/tests/build: update to not use gtkstock which is deprecated,
    the warning is making the autopkgtest unhappy
 -- Sebastien Bacher <email address hidden> Wed, 11 Dec 2013 10:52:41 +0100

Changed in gtk+3.0 (Ubuntu):
status: Triaged → Fix Released

Is there an ETA on when the patches are going to be merged into master?

Since the proposed patches to X have been rejected, what can be done here to fix this properly?

IMHO, this is quite an annoying regression.

Just in case it's not obvious what the effect is, there are steps to reproduce it at https://bugs.launchpad.net/ubuntu/+source/gtk+3.0/+bug/1240957: you just have to run two apps like gnome-terminal and nautilus and try using the mouse wheel to scroll them. nautilus no longer scrolls with the mouse wheel unless it has focus, whereas gnome-terminal always scrolls. Scrolling without requiring focus has always been one of the nice things about X desktops, and now it's inconsistent and broken.

Changed in compiz:
status: Invalid → In Progress
importance: Undecided → Medium
assignee: nobody → Christopher Townsend (townsend)
milestone: none → 0.9.11.0
Changed in compiz (Ubuntu):
status: New → In Progress
importance: Undecided → Medium
assignee: nobody → Christopher Townsend (townsend)
Changed in xorg-server (Ubuntu):
status: Triaged → Won't Fix
Changed in compiz (Ubuntu):
status: In Progress → Fix Released
Changed in compiz:
status: In Progress → Fix Committed
Stephen M. Webb (bregma) on 2014-11-06
Changed in compiz:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.