No functional changes intended. The new xcb_damage_query_version() was
previously done by XDamageQueryExtension() internally.
Signed-off-by: Uli Schlachter <psychon@znc.in>
If an X event is received at a very specific point in time, it can trigger
a race condition in Xlib. Said event will be read, but Xlib will
nonetheless be completely unaware of the event.
This cause compton to sometimes block on select() while there are events
ready to be processed. If the event is a damage report, screen freeze
will happen until some other event is received.
The proper fix is to switch to xcb for event handling, thus avoid this
problem entirely.
There seems to be a race between DamageAdd (what the client uses
to report damage to Xserver) and DamageSubtract (what compton uses
to clear the reported damage, so it can receive new ones). I am not
sure how to confirm this. But this (terrible) workaround seems to
solve this problem.
* Move code around
* Remove unneeded forward declaration
* Rename win->damaged to win->ever_damaged, to be less confusing
* Expose debug functions even when DEBUG is not enabled. Compiler
would remove the dead code for us anyway.
* Some code cleanup
Also move static function prototypes out of compton.h. Seems like the
previous developers didn't know what header files are for.
Seems to have bugs after the split.
Before becoming the selection owner for _NET_WM_CM_Sn, compton will now check if
that selection is already owned (which means that another composite manager is
already running). If this check fails, startup will be refused. This behaviour
is required by EWMH / ICCCM.
Because this should catch all composite managers, the error message that was
used before when another manager is already running is reworded to mention that
the other manager does not follow EWMH.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Under extreme race conditions (window A close at the same time as window
B create), there can be multiple windows with same id in compton's window
list. If at this point window B closes itself as well, finish_destroy_win
might destroy a different window as what's passed to destroy_callback.
This can be a problem because someone can still hold a reference to that
window (e.g. 't' in paint_preprocess), and there's no way to clear that
reference. If finish_destroy_win always destroy the same window passed
to destroy_callback, this will not be a problem.
GitHub: Add a template for issues submitted, .github/issue_template.md.
I hope people could provide more needed information when reporting
issues after we provide a number of fields to fill and some extra
instructions in the template, to reduce the time wasted on the issues
because of insufficient information.
See: https://help.github.com/articles/creating-an-issue-template-for-your-repository/