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/
compton-convgen: Misc: Clean up. The commit brings no change to the
functionality of the script.
- Partially fix PEP 8 compliance:
- Place imports on separate lines.
- Replace leading tabs with 4 spaces.
- Add docstrings to classes and functions.
- Surround top-level function and class definitions with two blank
lines.
- Remove spaces around keyword arguments.
- Move all statements to separate lines.
- Break some long lines into several lines.
- Remove trailing semicolons after statements.
- CGError: Use functionality from the base class Exception to store the
description, instead of the custom logic.
- CGInternal: Remove, as it is unused.
- Hide the internal function gen_invalid() and args_readfactors() by
prefixing their names with an underscore.
- Move the module-level command-line handling code to two new
functions, _main() and _parse_args(), and only execute if running in
the main scope.
Misc: Create directories for icons before installing them. This fixes
the install failure if the DESTDIR used when executing `make install`
does not contain the icon directories. It could appear when the user
does not wish to directly install the software to the system, like in
Gentoo ebuild or Arch Linux AUR building.
- Remove the const function attribute from get_time_*(), since the
functions they call that actually get the time probably access global
variables or have other behaviors unacceptable for const functions.
- Change the const function attribute on win_has_frame() to pure, as it
accesses memory its parameter points to, which is invalid for a const
function.