Bug 75115 - interl-virtual-output Pointer gone or misbehave if switch to VC and back to Xorg
Summary: interl-virtual-output Pointer gone or misbehave if switch to VC and back to Xorg
Status: RESOLVED FIXED
Alias: None
Product: xorg
Classification: Unclassified
Component: Driver/intel (show other bugs)
Version: unspecified
Hardware: x86-64 (AMD64) Linux (All)
: medium minor
Assignee: Chris Wilson
QA Contact: Intel GFX Bugs mailing list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-02-17 20:10 UTC by Raul Dias
Modified: 2014-02-18 08:07 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
i-v-o log when mouse pointer does not shown (23.44 KB, text/plain)
2014-02-17 20:10 UTC, Raul Dias
no flags Details
i-v-o log when mouse pointer goes crazy (34.67 KB, text/plain)
2014-02-17 20:10 UTC, Raul Dias
no flags Details

Description Raul Dias 2014-02-17 20:10:04 UTC
Created attachment 94236 [details]
i-v-o log when mouse pointer does not shown

Using i-v-o, with NVidia optimus.

If switched to a VC and back to Xorg one of two things happens:

1 - Mouse Pointer is gone.
In this case you can see desktop interaction with a invisible pointer (e.g. onmouseover events).

2 - Bad tracking of the pointer.
In this case it is clear the the tracking of the mouse losts its way.
e.g. when moving the mouse right it vanishes and reappear and the center of the screen.
Some times there is a pointer in the Intel Display and another at the i-v-o display.
Like the situation (1), the desktop reacts to the mouse events like onmouseover and this does not correspond to the pointer being shown.
e.g. the mouse pointer could be in the lower part of the screen and the interaction event is happening at to left (application toolbar).


I am adding a log for each situation (intel-virtual-output -a -b -f).
Comment 1 Raul Dias 2014-02-17 20:10:42 UTC
Created attachment 94237 [details]
i-v-o log when mouse pointer goes crazy
Comment 2 Chris Wilson 2014-02-17 20:39:41 UTC
In both logs, there is an "unknown event 34" (which is the MappingNotify upon VT switch) and thence mouse updates stop.

Can you please try:

diff --git a/tools/virtual.c b/tools/virtual.c
index cba247b..308f44e 100644
--- a/tools/virtual.c
+++ b/tools/virtual.c
@@ -2987,7 +2987,8 @@ int main(int argc, char **argv)
                if (reconfigure && context_update(&ctx))
                        display_reset_damage(ctx.display);
 
-               XPending(ctx.record);
+               while (XPending(ctx.record))
+                       XNextEvent(ctx.record, &e);
 
                if (ctx.timer_active && read(ctx.timer, &count, sizeof(count)) > 0) {
                        struct clone *clone;
Comment 3 Raul Dias 2014-02-17 21:42:32 UTC
Good job Chris.
That seems to nail down the problem.
Comment 4 Chris Wilson 2014-02-18 08:07:13 UTC
commit ecc20fbcf8d5adb6c3b7d005c01788e35bba9d3c
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Tue Feb 18 07:56:07 2014 +0000

    intel-virtual-output: Discard unwanted events from the mouse recorder
    
    X always sends MappingNotify events (there is no way for the client
    to ignore them). In particular, MappingNotify would be sent after a VT
    switch, and this would knock out our ability to track the cursor..
    
    Reported-by: Raul Dias <raul@dias.com.br>
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75115
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>


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.