I might clarify why this needs an X Server patch in order to function correctly:
Basically we used the shape extension in order to remove the input area from windows once they are "minimized" such that their pixmaps will still be valid and display in the alt-tab. However, because of the way reparenting works in compiz, compiz needs to know when the input shape of the client has changed so that it can adjust the parent window shape appropriately. But, we listen for shape events inside of unity in order to ensure that applications that change their input shape while minimized don't end up becoming "invisible windows" with input. However, changing the input shape with events registered would result in cycling because we'd be acting on our own requests to change the input shape. But core needs to have the events to change the input shape too! What I decided to do in the unity plugin was to disable input shape event reporting when we actually change the input and bounding shape of the window and then send synthetic ShapeNotify events to the frame windows (which compiz owns) such that core would update the shape region on the frame window correctly and have the right idea of what the input shape was. All events which are synethetic and generated by clients doing XSendEvent always have the "send_event" member of the XEvent structure forced on. Unfortunately, this works a little differently in the wire protocol for the X Server. "SendEvent" was probably bolted on to the protocol a little bit after X11 was formalized, so in order to avoid breaking the protocol version the developers made it so that any request that was sent from a SendEvent request would have the high bit (0x80) set in the event type mask. However the protocol is unclear as to where this high bit should actually be set, as all it says is "forced on". As such, there are some extension libraries that set the high bit before converting the event to wire protocol format and some extension libraries that rely on the server to do it before sending it to the client. For the former case, this was broken because the server doesn't unmask the high bit before doing range checks on the event type, which meant that for some synethetic requests (eg Shape requests) they would fall outside of the acceptable event range set by the X Server at runtime. (So when sending synethetic ShapeNotify events it will return an X Error saying that the event type is out of range even when the event type is actually valid). I've sent the patch to fix this upstream [1] and they're going to merge it so I'm just waiting on RAOF to backport it so that this method works correctly. I initially tried hacking around this by forcing the window to be resized when it was minimized but that doesn't work correctly with some clients (like chromium), so this is the only way to do it. You can tell if your server is broken by running the "test-input-remover" test in unity/tests/test-input-remover, if it returns an X Error saying that the event type "0xcc" was a BadValue then your server is definitely broken :) (The server should have processed the event type 0x4c) [1] http://lists.x.org/archives/xorg-devel/2011-September/025017.html On Sun, Sep 18, 2011 at 11:53 AM, Sam Spilsbury <[email protected]> wrote: > Ok, no problem, I've asked RAOF to merge the X Server patch I sent > upstream but he's been at XDC this past week so that will probably > happen monday. > > On Sat, Sep 17, 2011 at 11:05 PM, Andrea Azzarone > <[email protected]> wrote: >> I can confirm this bug too. It's quite annoying. >> >> -- >> You received this bug notification because you are a member of Unity >> Bugs, which is subscribed to unity in Ubuntu. >> https://bugs.launchpad.net/bugs/848237 >> >> Title: >> minimizing application creates an invisible window >> >> Status in “unity” package in Ubuntu: >> Confirmed >> Status in “unity” source package in Oneiric: >> Confirmed >> >> Bug description: >> If I open some applications, then I minimize one it leaves behind an >> invisible window until I restore the window. >> >> Steps to reproduce: >> 1. open firefox, evolution and rhythmbox >> 2. make sure they are overlapping in some manner >> 3. minimize rhythmbox >> 4. try to click in evolution or firefox where rhythmbox used to be. Focus >> is not changed and mouse clicks do not go to the window you are clicking on >> >> If I click the rhythmbox icon in the Launcher (ie, unminimize it), >> then mouse clicks, etc operate as expected. This is not rhythmbox >> specific-- eg if I minimize evolution the same things happens. >> >> I did enable the copytex plugin today as mentioned in bug #771521 >> since it is now supposed to be the default. I am up to date as of a >> few minutes ago. >> >> WORKAROUND: don't minimize anything >> >> ProblemType: Bug >> DistroRelease: Ubuntu 11.10 >> Package: unity 4.14.2-0ubuntu2 >> ProcVersionSignature: Ubuntu 3.0.0-11.17-generic 3.0.4 >> Uname: Linux 3.0.0-11-generic x86_64 >> .tmp.unity.support.test.0: >> >> ApportVersion: 1.22.1-0ubuntu2 >> Architecture: amd64 >> CompizPlugins: >> [core,bailer,detection,composite,opengl,compiztoolbox,decor,snap,gnomecompat,grid,place,copytex,session,mousepoll,vpswitch,regex,move,imgpng,resize,wall,animation,unitymtgrabhandles,resizeinfo,workarounds,expo,ezoom,staticswitcher,fade,scale,unityshell] >> CompositorRunning: compiz >> Date: Mon Sep 12 15:03:32 2011 >> DistUpgraded: Log time: 2011-07-22 19:38:51.178194 >> DistroCodename: oneiric >> DistroVariant: ubuntu >> GraphicsCard: >> Intel Corporation Core Processor Integrated Graphics Controller >> [8086:0046] (rev 02) (prog-if 00 [VGA controller]) >> Subsystem: Lenovo Device [17aa:215a] >> InstallationMedia: Ubuntu 11.04 "Natty Narwhal" - Release amd64 (20110425.2) >> MachineType: LENOVO 5129CTO >> ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-3.0.0-11-generic >> root=UUID=88689ad2-74b5-442c-9290-8ae60b63e16b ro quiet splash vt.handoff=7 >> SourcePackage: unity >> UnitySupportTest: Error: command ['/usr/lib/nux/unity_support_test', '-p', >> '-f'] failed with exit code -11: >> UpgradeStatus: Upgraded to oneiric on 2011-07-23 (51 days ago) >> dmi.bios.date: 02/24/2011 >> dmi.bios.vendor: LENOVO >> dmi.bios.version: 6QET64WW (1.34 ) >> dmi.board.name: 5129CTO >> dmi.board.vendor: LENOVO >> dmi.board.version: Not Available >> dmi.chassis.asset.tag: No Asset Information >> dmi.chassis.type: 10 >> dmi.chassis.vendor: LENOVO >> dmi.chassis.version: Not Available >> dmi.modalias: >> dmi:bvnLENOVO:bvr6QET64WW(1.34):bd02/24/2011:svnLENOVO:pn5129CTO:pvrThinkPadX201s:rvnLENOVO:rn5129CTO:rvrNotAvailable:cvnLENOVO:ct10:cvrNotAvailable: >> dmi.product.name: 5129CTO >> dmi.product.version: ThinkPad X201s >> dmi.sys.vendor: LENOVO >> version.compiz: compiz 1:0.9.5.94+bzr2803-0ubuntu1 >> version.ia32-libs: ia32-libs N/A >> version.libdrm2: libdrm2 2.4.26-1ubuntu1 >> version.libgl1-mesa-dri: libgl1-mesa-dri 7.11-0ubuntu3 >> version.libgl1-mesa-dri-experimental: libgl1-mesa-dri-experimental N/A >> version.libgl1-mesa-glx: libgl1-mesa-glx 7.11-0ubuntu3 >> version.xserver-xorg: xserver-xorg 1:7.6+7ubuntu7 >> version.xserver-xorg-input-evdev: xserver-xorg-input-evdev 1:2.6.0-1ubuntu13 >> version.xserver-xorg-video-ati: xserver-xorg-video-ati >> 1:6.14.99~git20110811.g93fc084-0ubuntu1 >> version.xserver-xorg-video-intel: xserver-xorg-video-intel >> 2:2.15.901-1ubuntu2 >> version.xserver-xorg-video-nouveau: xserver-xorg-video-nouveau >> 1:0.0.16+git20110411+8378443-1 >> >> To manage notifications about this bug go to: >> https://bugs.launchpad.net/ubuntu/+source/unity/+bug/848237/+subscriptions >> > > > > -- > Sam Spilsbury > -- Sam Spilsbury -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/848237 Title: minimizing application creates an invisible window To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/unity/+bug/848237/+subscriptions -- ubuntu-bugs mailing list [email protected] https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
