IANAL, but I think I am allowed to add missing copyright notices for
someone else. And I did my best job using git history to figure out who
wrote which functions. So I hope everything is fine.
Bugs:
* There seems to be a noticeable frame loss when window
is being opened/closed. But the same problem also exists
in master/next, so this is not a regression.
* Using --sw-opti and --benchmark at the same time causing
compton to draw more frequently than permitted by the
arguments. That is because the sleep interval calculation
is flawed. Not really a regression either.
Verified still working:
* Usual painting
* Fade
* Benchmark mode
* --sw-opti (with or without benchmark mode)
* DBus
* Unredir delay
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
Re-did the painting logic, and document it.
It is unclear to me what is the previous painting logic. But the current
one is basically this:
1. Go through all windows top to bottom, and put visible windows (not
unmapped, opacity > 0, etc) into a linked list, from bottom to top
2. Accumulate a region of ignore on each window, which is basically the
region of screen that is obscured by all the windows above current
one.
3. Paint all the visible windows from bottom to top. Subtract the region
of ignore from the painting region. If we need to paint shadow, we
subtract the body of the window from the shadow painting region too,
because we don't want shadow behind the window.
4. region of ignore is invalidated when window stack change, an
window on top moved or changed shape, when window changed between
opaque and transparent, etc.
Notes:
It is unclear whether all the different shapes of a window (extents,
noframe, border, bounding shape, etc) are calculated correctly or not.
It is unclear if window shape related events are handled correctly or
not. Need more testing.
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
Change `win *` to `win **`, because a window could be freed by the
callback, so we can set `*w` to NULL to communicate that.
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
Also remove some debug function calls (there are better tools for opengl
debugging now). Also remove copysubbuffermesa
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
Instead use win_has_alpha to check for alpha channel, window mode is
reserved for determine if the window is possibly transparent.
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
The existing mechanism with set_ignore_next() is (IMHO) ugly and also
does not work with XCB requests. This commit adds a new function
set_ignore_cookie() and fixes callers that were converted to XCB to use
this new function instead.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Errors for requests sent via Xlib that expect a reply are handled via
XSetErrorHandler(), which sets up a callback function that Xlib calls.
Errors for requests that do not expect a reply or for errors caused via
unchecked XCB requests show up as events of type 0 in the event handling
function.
Before this commit, errors were ignored here. This commit changes the
code so that the errors are printed instead.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Note that this adds an include for Xfixes.h, because that header is
still needed and was previously included through Xcomposite.h.
Signed-off-by: Uli Schlachter <psychon@znc.in>