Bug 18057 - xinput scrollwheelemulation not working after suspend
Summary: xinput scrollwheelemulation not working after suspend
Status: RESOLVED FIXED
Alias: None
Product: xorg
Classification: Unclassified
Component: Input/evdev (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Peter Hutterer
QA Contact: Xorg Project Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-10-14 03:02 UTC by Chris Jones
Modified: 2008-10-27 06:12 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
disables ABI checking for xinput (495 bytes, patch)
2008-10-14 06:09 UTC, Chris Jones
no flags Details | Splinter Review
Xorg log (27.25 KB, text/x-log)
2008-10-14 15:54 UTC, Chris Jones
no flags Details

Description Chris Jones 2008-10-14 03:02:42 UTC
I am running Ubuntu Intrepid

Linux kodachi 2.6.27-7-generic #1 SMP Fri Oct 10 03:55:24 UTC 2008 i686 GNU/Linux

ii  xserver-xorg                               1:7.4~2ubuntu7                        the X.Org X server
ii  xserver-xorg-core                          2:1.5.1-1ubuntu3                      Xorg X server - core server
ii  xserver-xorg-input-evdev                   1:2.0.99+git20080912-0ubuntu3         X.Org X server -- evdev input driver

I configure scrollwheel emulation with:

xinput set-int-prop "TPPS/2 IBM TrackPoint" "Wheel Emulation" 8 1
xinput set-int-prop "TPPS/2 IBM TrackPoint" "Wheel Emulation Button" 8 2

after a suspend/resume cycle, xinput reports that the emulation setting is still enabled and the mouse behaves as if it is working, but it doesn't actually send scroll events.

Also reported at: https://bugs.launchpad.net/ubuntu/+source/xserver-xorg-input-evdev/+bug/282387
Comment 1 Peter Hutterer 2008-10-14 03:49:35 UTC
I fixed that today, can you please fetch from git and try again?
Comment 2 Chris Jones 2008-10-14 04:09:44 UTC
Peter: thanks for the swift response! I don't suppose that comes down to a single commit does it? It would be by far easiest for me to test if I could quickly apply a patch to the package I have and rebuild it.
If not then nevermind, I'll grab the whole thing and build it :)
Comment 3 Peter Hutterer 2008-10-14 04:51:11 UTC
b0737bdbd1f6e601eb4984b6f4cb49279190984ca should have been it.

It'd be great if you could test git tip too though.
Comment 4 Chris Jones 2008-10-14 06:09:49 UTC
Created attachment 19651 [details] [review]
disables ABI checking for xinput
Comment 5 Chris Jones 2008-10-14 06:11:38 UTC
I'm not exactly sure if I'm doing the right things in testing this, but if I am, I don't think it's working.

I did:

git clone git://anongit.freedesktop.org/xorg/driver/xf86-input-evdev
git branch --track evdev-2.1-branch origin/evdev-2.1-branch
git checkout evdev-2.1-branch
applied ubuntu's ABI skipping patch (attached)
./autogen.sh --prefix=/usr
make
sudo make install

restarted X

I now see more xinput properties:


Device 'TPPS/2 IBM TrackPoint':
	Device Enabled:		1
	Evdev Axis Inversion:		0, 0
	Evdev Reopen Attempts:		10
	Evdev Middle Button Emulation:		0
	Evdev Middle Button Timeout:		50
	Evdev Wheel Emulation:		0
	Evdev Wheel Emulation Axes:		0, 0, 4, 5
	Evdev Wheel Emulation Inertia:		10
	Evdev Wheel Emulation Timeout:		200
	Evdev Wheel Emulation Button:		0
	Evdev Drag Lock Buttons:		0
	Wheel Emulation:		1
	Wheel Emulation Button:		2
	Wheel Emulation Y Axis:		4, 5

(not the default values, I played a little)

I see Wheel Emulation and Evdev Wheel Emulation, but enable either/both doesn't stop button 2 (middle) behaving purely as paste.
Comment 6 Peter Hutterer 2008-10-14 15:02:37 UTC
>         Evdev Wheel Emulation:          0
>         Evdev Wheel Emulation Button:           0

>         Wheel Emulation:                1
>         Wheel Emulation Button:         2
>         Wheel Emulation Y Axis:         4, 5

you created new properties with your command. the property names are all prefixed with "Evdev ". Try again with the right property name (or the number, that'll work too)
Comment 7 Chris Jones 2008-10-14 15:53:29 UTC
Sorry, I did try setting those too, but it doesn't seem to help...

Fresh start:

  Evdev Wheel Emulation:    0
  Evdev Wheel Emulation Axes:   0, 0, 4, 5
  Evdev Wheel Emulation Inertia:    10
  Evdev Wheel Emulation Timeout:    200
  Evdev Wheel Emulation Button:   4

xinput set-int-prop "TPPS/2 IBM TrackPoint" "Evdev Wheel Emulation Button" 8 2
xinput set-int-prop "TPPS/2 IBM TrackPoint" "Evdev Wheel Emulation" 8 1

  Evdev Wheel Emulation:    1
  Evdev Wheel Emulation Axes:   0, 0, 4, 5
  Evdev Wheel Emulation Inertia:    10
  Evdev Wheel Emulation Timeout:    200
  Evdev Wheel Emulation Button:   2

Middle button still acts as a pure middle button.
Comment 8 Chris Jones 2008-10-14 15:54:06 UTC
Created attachment 19654 [details]
Xorg log
Comment 9 Peter Hutterer 2008-10-14 17:56:02 UTC
wait, does it work at all? or just not after resume?
Comment 10 Chris Jones 2008-10-15 01:33:37 UTC
With the version currently shipping in Ubuntu Intrepid it works at first, but then stops after a suspend.

I've not been able to get the git version to work at all, but I should probably do a full reboot to be sure.
Comment 11 Niklas Vanhainen 2008-10-24 16:13:46 UTC
I had this same problem on Ubuntu 8.10. I just tried the latest git version and it did indeed fix the problem as far as I can tell. I'm going on about a dozen suspend-resume cycles and still no problems.
Comment 12 Niklas Vanhainen 2008-10-24 16:50:40 UTC
I had a peculiar problem once I installed the git version. Every time I hit Ctrl-C, the X-server would crash, and every time I hit Alt-F4, it would switch to a terminal.
I don't know if this is related but I thought I'd better let you know. The problem was resolved by reinstalling the Ubuntu version of evdev, which is from git on 2008-09-12.
Comment 13 Niklas Vanhainen 2008-10-25 08:30:14 UTC
Ok, so I used the b0737bdbd1f6e601eb4984b6f4cb49279190984c commit to patch the Ubuntu version, and it solved the scrolling problem I had with the Ubuntu version as well as the crashing problem I had with HEAD, but it appears that another bug was introduced. After a VT-switch I cannot drag things with the mouse, for instance drag a window or copy with the mouse. 
I'm guessing thats what draglock that was mentioned in the commit is for?
Comment 14 Peter Hutterer 2008-10-26 22:51:32 UTC
On Sat, Oct 25, 2008 at 08:30:15AM -0700, bugzilla-daemon@freedesktop.org wrote:
> Ok, so I used the b0737bdbd1f6e601eb4984b6f4cb49279190984c commit to patch the
> Ubuntu version, and it solved the scrolling problem I had with the Ubuntu
> version as well as the crashing problem I had with HEAD, but it appears that
> another bug was introduced. After a VT-switch I cannot drag things with the
> mouse, for instance drag a window or copy with the mouse. 
> I'm guessing thats what draglock that was mentioned in the commit is for?

no. draglock is a feature for those who can't hold a button down while
dragging. shouldn't affect standard mouse operation at all.
the problem is caused because the wakeup handlers didn't register again. Please
try the patch below, fixes the problem for me.


commit ea13733382f85dec6cadfb631831cfa6ed4bc69a
Author: Peter Hutterer <peter.hutterer@redhat.com>
Date:   Mon Oct 27 15:54:49 2008 +1030

    emuMB: add EvdevMBEmuOn and call from EvdevOn to register wakeup handlers.
    
    This got broken in b0737bdbd1f6e601eb4984b6f4cb49279190984c, when the
    EmuMBPreInit call was removed from EvdevOn. As a result, VT switching away and
    back wouldn't restore the wakeup handlers and mouse button presses
    disappeared.

diff --git a/src/emuMB.c b/src/emuMB.c
index 4af0791..e5a767a 100644
--- a/src/emuMB.c
+++ b/src/emuMB.c
@@ -317,6 +317,11 @@ EvdevMBEmuPreInit(InputInfoPtr pInfo)
 
     pEvdev->emulateMB.timeout = xf86SetIntOption(pInfo->options,
                                                  "Emulate3Timeout", 50);
+}
+
+void
+EvdevMBEmuOn(InputInfoPtr pInfo)
+{
     RegisterBlockAndWakeupHandlers (EvdevMBEmuBlockHandler,
                                     EvdevMBEmuWakeupHandler,
                                     (pointer)pInfo);
diff --git a/src/evdev.c b/src/evdev.c
index d112efe..26ae0a1 100644
--- a/src/evdev.c
+++ b/src/evdev.c
@@ -1008,6 +1008,7 @@ EvdevOn(DeviceIntPtr device)
     } else
     {
         xf86AddEnabledDevice(pInfo);
+        EvdevMBEmuOn(pInfo);
         pEvdev->flags |= EVDEV_INITIALIZED;
         device->public.on = TRUE;
     }
diff --git a/src/evdev.h b/src/evdev.h
index c2f614a..7e1da15 100644
--- a/src/evdev.h
+++ b/src/evdev.h
@@ -127,6 +127,7 @@ BOOL EvdevMBEmuFilterEvent(InputInfoPtr, int, BOOL);
 void EvdevMBEmuWakeupHandler(pointer, int, pointer);
 void EvdevMBEmuBlockHandler(pointer, struct timeval**, pointer);
 void EvdevMBEmuPreInit(InputInfoPtr);
+void EvdevMBEmuOn(InputInfoPtr);
 void EvdevMBEmuFinalize(InputInfoPtr);
 void EvdevMBEmuEnable(InputInfoPtr, BOOL);
Comment 15 Niklas Vanhainen 2008-10-27 06:12:20 UTC
Great thanks, that works perfectly.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.