Previously we were using glibc's strtod function to parse floating point
numbers. The problem is, strtod is locale dependent. Meaning 7,7 might
be parsed as two numbers (7 and 7) in one locale, and parsed as one
number (7 point 7) in another locale. This is undesirable.
We need to set the locale to a value we know to make number parsing
consistently. We could use setlocale(), but that is not thread-safe. We
can also use uselocale(), which is thread-safe, but doesn't cover strtod
(Yeah, some of the locale-aware functions only acknowledge the global
locale, not the thread local one).
So in frustration, I just wrote a simple floating point number parser
myself. This parser obviously doesn't cover all cases strtod covers, but
is good enough for our needs.
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
Also add a new option "log-file" to config file and command line, it
doesn the same thing as --logpath.
--logpath was never documented, and "log-file" is more consistent with
the naming of options.
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
* -d: because the standard way is to use $DISPLAY
* no-name-pixmap: undocumented debugging option
* -S: debugging option, not very useful
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
* Removed the AUTHORS section as recommended by man-pages(7),
the conventions for writing Linux man pages.
* Change the secion name to the more commonly used "User Commands".
* Don't say "this man page might be out dated".
* Always use the current version number of compton as "man version" in
the man pages.
Also bumped the project version in meson.build
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
Both methods are redundant. Prefer Mesa's own extension when available,
fall back to the old SGI extension otherwise (NVIDIA drivers for the
most part).
This cause certain window types to be ignored in deciding whether the
screen should be redirected after being unredirected.
Fixes#58
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
Remove alpha_step, and support all 256 alpha values.
1 pixel pictures don't really use that many resources.
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
When this option is enabled for a window type, shadow will be drawn in
areas that are obscure by the shape of the window.
Useful when the given window type has parts of the window transparent,
and you want to have shadows in those areas.
Fixes#45
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This reverts commit 50e2259404.
Temporarily revert the removal until we have more information about this whole
thing.
Turns out a couple of drivers don't work properly without the sync fence,
including intel, llvmpipe and NVIDIA.
Although sync fence is needed, from the information I have gathered (looking
at old bug reports, protocol specifications, look at other compositors' code),
compton's usage of it is not proper. So we need to rewrite it in the future,
after we get more information from driver developers.
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This was a dubious "fix" for a Nvidia driver problem. The problem was
never fully understood, and the then developers took a shotgun approach
and implemented xsync fences as a fix. Which somehow fixed the problem.
Again, I don't see any indication that the developers understood why
this "fix" worked.
(for details, see chjj/compton#152 and chjj/compton#181)
The driver problem should have been fixed almost 5 years ago. So this
shouldn't be needed anymore. In addition the way compton uses xsync fences
is apparently wrong according to the xsync spec (fences are attached to
screen, but compton uses them as if they were attached to drawables).
So, I will try removing it and see if anyone will complain. If there are
real concrete reasons why fences are needed, it will be brought back.
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
Misc: Update the descriptions of --backend in the compton man page.
Mention `xr_glx_hybrid` backend, and add more descriptions of the
operation and characteristics of the backends. Thanks to @onodera-punpun
in the Gitter room for telling me about the missing documentation of the
`xr_glx_hybrid` backend.
- Reformat usage text by adding a blank line between descriptions of
two switches. (#215)
- Update documentation for a bit. Correct some wrong statements and
clarify some others.
Add `bounding_shape` and `rounded_corners` as condition match target.
Deprecate --shadow-ignore-shaped. Add rounded-corners detection to
win_is_fullscreen(). Slightly modify win_rounded_corners() logic. Thanks
to tdryer for reporting. (#191)
- Try to avoid evaluating conditions after window unmap/destruction.
Unfortunately, frequently this doesn't work due to the asynchronous
nature of X.
- Add _GTK_FRAME_EXTENTS exclusion rules to compton.sample.conf. Thanks
to memeplex, hexchain, and others for info. (#189)
- Add debugging option --show-all-xerrors, and other debugging changes.
Doc update.
- Add --write-pid-path to write process ID to a file, to help
determining compton's process ID when -b is used.
- Add a few extra targets to query through D-Bus opts_get (version, pid,
etc.) and through win_get, primarily for debugging.
- Add helper macros likely(), unlikely(), cmalloc(), ccalloc(),
crealloc().
- Change w->opacity_set to opacity_t. Determine display_repr in
session_init(), etc.
- Add stoppaint_force option, controlled via D-Bus, to stop painting
completely, which may look better than unredirecting the screen,
sometimes. (#41)
- Add x2, y2 matching targets.
- Update documentation.
- Add --paint-exclude to prevent certain windows from being painted, for
debugging purposes.
- Add predefined matching target "x", "y", "width", "height", "widthb",
"heightb", "border_width", and "fullscreen".
- Fix bug #119, wrong man page install dir in CMake configuration.
Thanks to sstewartgallus for reporting.
- GLX backend: Add --glx-swap-method, to reduce painting region if the
driver uses exchange or copy buffer swaps. Untested.
- Add --fade-exclude, to disable fading on specific windows based on
some conditions. Untested.
- Expose GLX backend options through configuration file. Add fetching of
GLX backend options through D-Bus.
- Use NULL pointer instead of element count to delimit string arrays in
parse_vsync()/parse_backend()/parse_glx_swap_method().
- Add documentation about "wintypes" section in configuration file.
- Add --blur-background-exclude. (#98)
- Add `opengl-mswc` VSync, which uses MESA_swap_control instead of
SGI_swap_control. I don't expect it to perform better than
SGI_swap_control, though.
- Update CMakeLists.txt .
- Add a few targets for D-Bus `win_get`. Misc changes.
- Known issue: Apparently I've forgotten implementing --inactive-dim on
GLX backend... Silly me.
- GLX backend: Add --glx-use-copysubbuffermesa, to use
MESA_copy_sub_buffer to do partial screen update. Huge performance
boost on mesa drivers for partial screen updates, but does not work
for nvidia-drivers and may break VSync. Automagically overrides
--glx-copy-from-front.
- Add rect_is_fullscreen() to reuse code. Misc changes.
- Add on-the-fly VSync option modification via D-Bus, as requested by
kunitoki (#80). Expose parse_vsync(), create vsync_init() and
ensure_glx_context().
- Change default value of ps->drm_fd to -1.
- Update Makefile. Change the install/uninstall rules and add doc
installation, requested by hasufell in #85.
- Mark window not damaged in map_win(). It helps in reducing flickering
with inverted window color, but I'm not completely sure if it's safe.
- Avoid modifying w->invert_color when window is unmapped.
- Update documentation. Thanks to hasufell for pointing out.
- Add advanced window matching system, capable of matching against
arbitrary window properties as well as a series of internal
properties, with 4 additional operators (>, <, >=, <=) useful for
integer targets, and support of logical operators. The old matching
system is removed, but compatibility with the format is retained.
- As the new matching system is pretty complicated, and I have no past
experience in writing a parser, it's pretty possible that bugs are
present. It also has inferior performance, but I hope it doesn't
matter on modern CPUs.
- It's possible to disable matching system at compile time with NO_C2=1
now.
- Add ps->o.config_file to track which config file we have actually
read. Queryable via D-Bus.
- Parse -d in first pass in get_cfg() as c2 needs to query X to get
atoms during condition parsing.
- Fix a bug in wid_get_prop_adv() that 0 == rformat is not handled
correctly.
- Fix incompatibility with FreeBSD sed in dbus-examples/cdbus-driver.sh
.
- Add recipe to generate .clang_complete in Makefile, used by Vim
clang_complete plugin.
- Add DEBUG_C2 for debugging condition string parsing. DEBUG_WINMATCH is
still used for match debugging.
- Rename win_on_wdata_change() to win_on_factor_change().
- Extra malloc() failure checks. Add const to matching cache members in
session_t. Code clean-up. Documentation update.
- Fix a bug that root window is not repainted on wallpaper change unless
an Expose X event is received. Seemingly, if there's no mapped window
on a screen, X will not send an Expose event when the wallpaper
changes. Thanks to baskerville for reporting.
- Fix a X Pixmap leak when there's no existing wallpaper pixmap found.
- Fix a bug in mstrncpy() that null character is not added to the end of
the copied string.
- Make VSYNC_STRS public, for use in src/dbus.c. Adjust the type of
WINTYPES array. Add NUM_VSYNC.
- Add more targets for various D-Bus methods. Add "bad_target" D-Bus
error. Improve error handling. Add more helper functions to append
arguments to a D-Bus message. Add Introspect method to D-Bus
introspection reply.
- Add public declarations of things in the new condition format code to
common.h. Move definitions of some inline functions from compton.h to
common.h. Make some functions public. Move wid_get_prop_adv() to
compton.c. The primary code files of the new format src/c2.{c,h} will
be published when ready.
- Add support for dumping version string in Makefile (make version), to
make snapshot generation easier.
- Add repeated inclusion protection to common.h.
- Update documentation.
- Use gsed instead of sed in dbus-examples/cdbus-driver.sh if possible,
as some BSD systems does not come with GNU sed by default. Thanks to
DaChiChang for reporting.
- Code clean-up. Small type changes in register_cm() to silence
warnings. Quit on failure in parse_vsync(). Apply stricter checks in
force_repaint().