After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 670396 - Mouse events delivered to invisible windows (as if they were "always on visible workspace")
Mouse events delivered to invisible windows (as if they were "always on visib...
Status: RESOLVED FIXED
Product: mutter
Classification: Core
Component: general
3.2.x
Other Linux
: Normal minor
: ---
Assigned To: mutter-maint
mutter-maint
Depends on:
Blocks:
 
 
Reported: 2012-02-19 13:25 UTC by Benjamin Berg
Modified: 2012-10-14 10:21 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Red area is the buggy area. (452.38 KB, image/jpeg)
2012-10-13 20:56 UTC, Benjamin Berg
  Details
Patch that fixes the problem (against master) (847 bytes, patch)
2012-10-13 21:47 UTC, Benjamin Berg
accepted-commit_now Details | Review

Description Benjamin Berg 2012-02-19 13:25:52 UTC
OK, this is weird, but it happens to me once in a while that mouse events are delivered to an invisible window. Suddenly I am able to interact with my windows on the secondary screen even if I am not on that specific workspace. I get flyover hints and can interact with the window in any other way. Apparently the event can even be delivered to multiple windows.

I am using gnome-shell, and I have no idea how I am triggering the issue. I am guessing it has something to do with my multiscreen setup. It is configured like this:
 1. workspaces_only_on_primary is set to FALSE
 2. My internal laptop screen is the secondary screen (external panel is primary and at the right side)

I quite often unplug the external monitor, so that the laptop screen becomes the primary monitor.
Comment 1 Jasper St. Pierre (not reading bugmail) 2012-10-13 18:07:49 UTC
It seems that windows aren't stacked behind the guard window correctly. We had some issues like this early in the gnome-shell development cycle.
Comment 2 Benjamin Berg 2012-10-13 20:49:12 UTC
OK, I don't know much about composition ...

So, as I understand it now, there is a window which is on top of all invisible window. This window catches the events.

OK, then it seems to me that the cause of the problem is quite simple. The window is not correctly resized when the monitor configuration changed. So what actually happens is that the guard window stays at the size of the laptop screen (1440x900px) and does not cover the complete area.

So I have:
 Laptop Screen: 1440x900px at the bottom right
 External Monitor: 1920x1080px at the top left

In the top left area of the external monitor in a rectangle of 1440x900px the problem does *not* occur. Everywhere else it does.
Comment 3 Jasper St. Pierre (not reading bugmail) 2012-10-13 20:56:13 UTC
Aha, that makes sense.

I'm not at a place where I can write a patch, but the thing would be to add an XConfigureWindow call in here, when the screen is resized:

    http://git.gnome.org/browse/mutter/tree/src/core/screen.c#n2864
Comment 4 Benjamin Berg 2012-10-13 20:56:15 UTC
Created attachment 226391 [details]
Red area is the buggy area.

Maybe that is relevant. It does not always happen, and I do plug/unplug the monitor while the laptop is in suspend.
Comment 5 Benjamin Berg 2012-10-13 21:47:18 UTC
Created attachment 226394 [details] [review]
Patch that fixes the problem (against master)

OK, cooking up the patch was really simple with that information; testing takes a bit more work though :-)

So, the attach patch seems to work (rebuild debian package with it applied which is mutter 3.4.1; restarted the shell with one monitor, enabled the second one and everything is fine). The unpatched package shows the issue.

Thanks for the pointers!
Comment 6 Jasper St. Pierre (not reading bugmail) 2012-10-13 23:53:01 UTC
Review of attachment 226394 [details] [review]:

Patch looks good. It needs a commit message and everything before you can push it, though.
Comment 7 Benjamin Berg 2012-10-14 10:21:38 UTC
benjamin@ben-tp:~/Projects/jhbuild/sources/mutter$ git log
commit 472662d0996b0b4db6355864c6e7944d31d3d62b
Author: Benjamin Berg <benjamin@sipsolutions.net>
Date:   Sun Oct 14 12:16:06 2012 +0200

    Resize the guard window when the X screen is resized.
    
    Fixes bug #670396. Without this fix the guard window may not
    extend over the whole area of the screen after a XRandR
    reconfiguration. The effect being that mouse events are
    delivered to invisible windows.