Setting glx-swap-method to value other than "undefined" and "buffer-age"
could potentially cause rendering problems. So remove them, the meaning
of the remaining options can be more precisely captured by "use-damage",
so create a new option under that name.
--glx-swap-method is deprecated in favor of the new option --use-damage.
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
Choose the best vsync method for the user, instead of asking them to
frustratingly try every one of the options to see what works.
With this commit, the `vsync` option will take only a boolean value.
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
Instead of storing them as an array of xfixed.
Might cause some performance overhead for the new backend, because
it is allocating a buffer to do the conversion every frame. Will fix
later.
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
Window state tracking is basically the back bond of window fading. We
add a new enum field to the win struct to track the state of the window,
instead of using a set of boolean variables. We also remove the fading
callbacks, since it is only used for fading, so the potential of code
reuse is lost. And it makes the code slightly harder to understand.
Also fixed a problem that --no-fading-openclose is not behaving as
advertised (from my observation, enabling this flag disables fading
entirely, instead of just diabling it for open/close).
Also uses double for opacity everywhere internally. Use opacity_t only
when setting X opacity prop.
TODO: Remove win::*_last
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
Previously the search order is:
~/.config/compton/compton.conf
/etc/xdg/compton/compton.conf
~/.config/compton.conf
/etc/xdg/compton.conf
...
Now the search order is:
~/.config/compton/compton.conf
~/.config/compton.conf
~/.compton.conf
/etc/xdg/compton/compton.conf
...
In other word, compton will now search all possible user config file
path first before searching for a system config file.
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>
* Pass a options_t, not session_t
* Slightly improve error handling when setting vsync method via dbus
The goal here is to limit the scope of what a given function can access.
And session_t contains basically everything, so don't pass it around.
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
Also add a new config file path:
{$XDG_CONFIG_DIRS,$XDG_CONFIG_HOME}/compton/compton.conf
(For those not familiar with xdg: now compton will look for
~/.config/compton/compton.conf too)
Closes#62
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
* string functions mstr*() are moved to string_utils.c
* allocation wrappers are moved to utils.h
* printf_* functions are moved to log.h
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
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>
Make sure the wintype options are properly initialized even when there
is no config file specified/supported.
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
I just realized wintype option shadow and fade never worked. If you set
the global shadow option to true, wintype shadow option will have no effect.
Now the wintype options will properly override the global ones.
Also remove deprecated options from compton.sample.conf.
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>
--dbe does not seem to have an effect on tearing, as noted in the old
manpage, and confirmed by my own testing.
So remove it, since it complicates the logic of painting.
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
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.
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>