Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds Animated Window Transitions #512

Open
wants to merge 33 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
525d0a0
init
BlackCapCoder Oct 7, 2017
f560391
Update README.md
BlackCapCoder Oct 7, 2017
f21d06c
options
BlackCapCoder Oct 8, 2017
8d54292
performance
BlackCapCoder Oct 8, 2017
ab21254
Animation no longer jumps if started in the middle of an animation
BlackCapCoder Oct 8, 2017
d72661a
Doubled default transition length
BlackCapCoder Oct 8, 2017
89f87fe
Minor bugfix, preformance
BlackCapCoder Oct 8, 2017
20a263b
Track x and y separately to aviod jumping in mid-animation repositioning
BlackCapCoder Oct 8, 2017
3bc0c36
Added video to readme
BlackCapCoder Oct 8, 2017
8ffd8bb
docs
BlackCapCoder Oct 8, 2017
a352288
docs
BlackCapCoder Oct 8, 2017
6e42d22
fixed graphical glitch with non-transparent windows
BlackCapCoder Oct 8, 2017
6814a5d
now animates window scaling too (but only if the window grows)
BlackCapCoder Oct 8, 2017
1767116
added options for size transitions
BlackCapCoder Oct 8, 2017
41f21be
and actually respect the new options..
BlackCapCoder Oct 8, 2017
2403165
and actually respect the new options..
BlackCapCoder Oct 8, 2017
0045773
added center-spawn option
BlackCapCoder Oct 8, 2017
2856a62
added center-spawn-screen option
BlackCapCoder Oct 8, 2017
1d8dd5e
fixed center spawn
BlackCapCoder Oct 8, 2017
1258d08
added no-scale-down
BlackCapCoder Oct 8, 2017
7ef2279
goofed
BlackCapCoder Oct 8, 2017
20494b1
remember old windows
BlackCapCoder Oct 8, 2017
f82a1f1
remember old windows
BlackCapCoder Oct 8, 2017
072df25
docs
BlackCapCoder Oct 8, 2017
0523855
fixed shadow
BlackCapCoder Oct 8, 2017
69a59f3
fixed shadow
BlackCapCoder Oct 8, 2017
c8b7182
fixed shadow
BlackCapCoder Oct 8, 2017
f0099f7
fixed shadow
BlackCapCoder Oct 8, 2017
289aa50
lost no-scale-down due to revert
BlackCapCoder Oct 8, 2017
88feb78
lost spawn-center due to revert
BlackCapCoder Oct 8, 2017
37e48fd
Fixed #2
BlackCapCoder Oct 11, 2017
92f24eb
fix missing window borders
shizonic Feb 2, 2019
dd5837b
Merge pull request #11 from shizonic/master
BlackCapCoder Feb 3, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
137 changes: 14 additions & 123 deletions README.md
@@ -1,123 +1,14 @@
# Compton

[![Join the chat at https://gitter.im/chjj/compton](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/chjj/compton?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

__Compton__ is a compositor for X, and a fork of __xcompmgr-dana__.

I was frustrated by the low amount of standalone lightweight compositors.
Compton was forked from Dana Jansens' fork of xcompmgr and refactored. I fixed
whatever bug I found, and added features I wanted. Things seem stable, but don't
quote me on it. I will most likely be actively working on this until I get the
features I want. This is also a learning experience for me. That is, I'm
partially doing this out of a desire to learn Xlib.

## Changes from xcompmgr:

* OpenGL backend (`--backend glx`), in addition to the old X Render backend.
* Inactive window transparency (`-i`) / dimming (`--inactive-dim`).
* Titlebar/frame transparency (`-e`).
* Menu transparency (`-m`, thanks to Dana).
* shadows are now enabled for argb windows, e.g. terminals with transparency
* removed serverside shadows (and simple compositing) to clean the code,
the only option that remains is clientside shadows
* configuration files (see the man page for more details)
* colored shadows (`--shadow-[red/green/blue]`)
* a new fade system
* VSync support (not always working)
* Blur of background of transparent windows, window color inversion (bad in performance)
* Some more options...

## Fixes from the original xcompmgr:

* fixed a segfault when opening certain window types
* fixed a memory leak caused by not freeing up shadows (from the freedesktop
repo)
* fixed the conflict with chromium and similar windows
* [many more](https://github.com/chjj/compton/issues)

## Building

### Dependencies:

__B__ for build-time

__R__ for runtime

* libx11 (B,R)
* libxcomposite (B,R)
* libxdamage (B,R)
* libxfixes (B,R)
* libXext (B,R)
* libxrender (B,R)
* libXrandr (B,R)
* libXinerama (B,R) (Can be disabled with `NO_XINERAMA` at compile time)
* pkg-config (B)
* make (B)
* xproto / x11proto (B)
* sh (R)
* xprop,xwininfo / x11-utils (R)
* libpcre (B,R) (Can be disabled with `NO_REGEX_PCRE` at compile time)
* libconfig (B,R) (Can be disabled with `NO_LIBCONFIG` at compile time)
* libdrm (B) (Can be disabled with `NO_VSYNC_DRM` at compile time)
* libGL (B,R) (Can be disabled with `NO_VSYNC_OPENGL` at compile time)
* libdbus (B,R) (Can be disabled with `NO_DBUS` at compile time)
* asciidoc (B) (and docbook-xml-dtd-4.5, libxml-utils, libxslt, xsltproc, xmlto, etc. if your distro doesn't pull them in)

### How to build

To build, make sure you have the dependencies above:

```bash
# Make the main program
$ make
# Make the man pages
$ make docs
# Install
$ make install
```

(Compton does include a `_CMakeLists.txt` in the tree, but we haven't decided whether we should switch to CMake yet. The `Makefile` is fully usable right now.)

## Known issues

* Our [FAQ](https://github.com/chjj/compton/wiki/faq) covers some known issues.

* VSync does not work too well. You may check the [VSync Guide](https://github.com/chjj/compton/wiki/vsync-guide) for how to get (possibly) better effects.

* If `--unredir-if-possible` is enabled, when compton redirects/unredirects windows, the screen may flicker. Using `--paint-on-overlay` minimizes the problem from my observation, yet I do not know if there's a cure.

* compton may not track focus correctly in all situations. The focus tracking code is experimental. `--use-ewmh-active-win` might be helpful.

* The performance of blur under X Render backend might be pretty bad. OpenGL backend could be faster.

* With `--blur-background` you may sometimes see weird lines around damaged area. `--resize-damage YOUR_BLUR_RADIUS` might be helpful in the case.

## Usage

Please refer to the Asciidoc man pages (`man/compton.1.asciidoc` & `man/compton-trans.1.asciidoc`) for more details and examples.

Note a sample configuration file `compton.sample.conf` is included in the repository.

## Support

* Bug reports and feature requests should go to the "Issues" section above.

* Our (semi?) official IRC channel is #compton on FreeNode.

* Some information is available on the wiki, including [FAQ](https://github.com/chjj/compton/wiki/faq), [VSync Guide](https://github.com/chjj/compton/wiki/vsync-guide), and [Performance Guide](https://github.com/chjj/compton/wiki/perf-guide).

## License

Although compton has kind of taken on a life of its own, it was originally
an xcompmgr fork. xcompmgr has gotten around. As far as I can tell, the lineage
for this particular tree is something like:

* Keith Packard (original author)
* Matthew Hawn
* ...
* Dana Jansens
* chjj and richardgv

Not counting the tens of people who forked it in between.

Compton is distributed under MIT license, as far as I (richardgv) know. See LICENSE for more info.
This is a fork of [Compton](https://github.com/chjj/compton) that adds animated window transitions. It is intended for tiling window managers, but may be useful to people who use a mouse as well.

Video: https://youtu.be/eKwPkiACqF0

It adds the following options:
* `transition-length` length of animation in milliseconds (default: 300)
* `transition-pow-x` animation easing on the x-axis (default: 1.5)
* `transition-pow-y` animation easing on the y-axis (default: 1.5)
* `transition-pow-w` animation easing on the window width (default: 1.5)
* `transition-pow-h` animation easing on the window height (default: 1.5)
* `size-transition` whether to animate window size changes (default: true)
* `spawn-center-screen` whether to animate new windows from the center of the screen (default: false)
* `spawn-center` whether to animate new windows from their own center (default: true)
* `no-scale-down` Whether to animate down scaling (some programs handle this poorly) (default: false)
24 changes: 24 additions & 0 deletions src/common.h
Expand Up @@ -568,6 +568,24 @@ typedef struct _options_t {
bool glx_use_copysubbuffermesa;
/// Whether to avoid rebinding pixmap on window damage.
bool glx_no_rebind_pixmap;
/// Length of window transitions
int transition_length;
/// For smoothing on the x-coordinate of window animations
float transition_pow_x;
/// For smoothing on the y-coordinate of window animations
float transition_pow_y;
/// For smoothing on the width of window animations
float transition_pow_w;
/// For smoothing on the height of window animations
float transition_pow_h;
/// Wether to animate on window size change
bool size_transition;
/// Wether to scale new windows in from the center of the screen
bool spawn_center_screen;
/// Wether to scale new windows in from their center
bool spawn_center;
/// Does not animate downscaling
bool no_scale_down;
/// GLX swap method we assume OpenGL uses.
int glx_swap_method;
/// Whether to use GL_EXT_gpu_shader4 to (hopefully) accelerates blurring.
Expand Down Expand Up @@ -1228,6 +1246,12 @@ typedef struct _win {
/// Background state on last paint.
bool blur_background_last;

int oldX; int oldY; int oldW; int oldH;
int newX; int newY; int newW; int newH;
float moveTimeX; float moveTimeY;
float moveTimeW; float moveTimeH;
bool isOld;

#ifdef CONFIG_VSYNC_OPENGL_GLSL
/// Textures and FBO background blur use.
glx_blur_cache_t glx_blur_cache;
Expand Down