Created attachment 46321 [details]
Test program to help reproduce the bug
If the root window and all its subwindows are redirected to off-screen storage by using XCompositeRedirectSubwindows with the update parameter set to CompositeRedirectAutomatic, some windows fail to repaint correctly in some conditions.
To reproduce this bug:
(1) ensure that windows are NOT currently redirected to off-screen storage
(2) run the attached test application, or run "xcompmgr -a" if you have it installed.
(3) open any regular window, then open a "menu" window so that it overlaps with it partially
(4) close the menu window and open it again in another position so that it will not overlap with the regular window
(5) observe that the part of the regular window that was covered by the first menu window is cleared and then it's not normally repainted anymore
I can reproduce reliably on a machine running Ubuntu Linux 11.04, which runs X.org version 1.10.1, with Linux kernel 2.6.24-29-server x86_64
The window manager running is Metacity (with Metacity's own compositor disabled).
The "menu" windows mentioned in steps 3 to 5 are those that appear when right clicking on the desktop. I don't know what is special about them in X11 terms, but there are no other windows that exhibit this behavior that I could find.
I could reproduce this bug both on an Nvidia card and on a machine with integrated Intel graphics.
Created attachment 46322 [details]
Screenshot of one of the windows showing the corrupt area
Sounds like bug 36699 / bug 22566 ...
(In reply to comment #2)
> I could reproduce this bug both on an Nvidia card [...]
Using which driver?
(In reply to comment #2)
> Sounds like bug 36699 / bug 22566 ...
> (In reply to comment #2)
> > I could reproduce this bug both on an Nvidia card [...]
> Using which driver?
It can be reproduced with nvidia, fglrx and intel. I haven't tried to reproduce it with radeon yet but, if it can help, I will.
The issue seems to be caused only when override redirect windows (such as GtkMenus) overlap a window, then the menu is destroyed and somehow the area previously occupied by the menu is clipped (and the wallpaper is visible) when a new menu (which doesn't overlap the same window) is created. Moving the window makes the hole go away as miMoveWindow() does a RegionCopy().
I guess something weird happens when the window is no longer marked as overlapped. Maybe miMarkOverlappedWindows() doesn't play well with override redirect windows in CompositeRedirectAutomatic mode.
Any ideas as to how I can further debug the issue?
I'm unable to reproduce this in 1.16. I suspect this was fixed by:
Author: Ville Syrjala <firstname.lastname@example.org>
Date: Sun Oct 9 01:11:04 2011 +0300
composite: Update borderClip in compAllocPixmap()
And that this is therefore sort of a duplicate of bug #22566.