Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Non-Opaque (semi-transparent) specially-shaped windows painted incorrectly. #38

Closed
richardgv opened this issue Sep 11, 2012 · 0 comments

Comments

@richardgv
Copy link
Collaborator

This is the second bug I indicated in the "by the way" part of a reply to the Maximized Chromium window issue, just lifted out here to make the issue easier to see: #36 (comment)

The problem:
When a specially shaped (non-rectangular) window becomes transparent, compton renders the part out of its shape incorrectly. Just run compton, run oclock, then set oclock window's opacity to like 50%, and you see the issue. Try moving the oclock window around if it's not obvious where the problem is.

The patch:

Should I repeat my usual words that I know nothing and this patch can be very unreliable? :-) It's taken from xcompmgr:

diff --git a/src/compton.c b/src/compton.c
index b72dc59..57f9926 100644
--- a/src/compton.c
+++ b/src/compton.c
@@ -1122,6 +1122,10 @@ paint_all(Display *dpy, XserverRegion region) {
     if (w->mode != WINDOW_SOLID || HAS_FRAME_OPACITY(w)) {
       int x, y, wid, hei;

+      // Necessary to make sure specially-shaped windows are
+      // painted correctly
+      XFixesIntersectRegion(dpy, w->border_clip, w->border_clip, w->border_size);
+      XFixesSetPictureClipRegion (dpy, root_buffer, 0, 0, w->border_clip);
 #if HAS_NAME_WINDOW_PIXMAP
       x = w->a.x;
       y = w->a.y;

By the way:

To make sure you don't get puzzled, here's a list of the patches I posted that needs review so far:

richardgv added a commit that referenced this issue Sep 11, 2012
@chjj chjj closed this as completed Sep 13, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants