Commit Graph

19 Commits

Author SHA1 Message Date
Yuxuan Shui 2e2e8e3ce0
Use struct conv for blur kernel as well
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>
2019-02-20 01:39:43 +00:00
Yuxuan Shui a826e0ce79
Window state tracking refactor
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>
2019-02-17 16:37:28 +00:00
Yuxuan Shui 5fffb6f3f6
Fork as early as possible
If fork is requested, we fork as early as possible, way before anything
is initialized. This way, we don't need to do the gymnastics to make
OpenGL work properly across fork.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-02-08 01:33:42 +00:00
Yuxuan Shui a019ff453b
Make get_early_config even earlier
Also improve the management of X Display and session_t.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-02-07 22:45:44 +00:00
Yuxuan Shui f649a949e2
Even more includes
Expand the modulemap to cover some of the system headers too.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-01-20 22:09:22 +00:00
Yuxuan Shui 916e23861a
Improve the header includes, cont'd
Also check in the modulemap file, and add a option to build with clang's
-fmodules.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-01-20 17:10:06 +00:00
Yuxuan Shui 1e0deea57f
Improve the include situation
Slightly clean up header inclusion with the help of clang's module system.
It's better for files to include the things you need directly.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-01-18 23:30:44 +00:00
Yuxuan Shui 80847dd3fa
Refactor the XSync fence code
Use a temporary fence everytime. Convert the Xlib XSync functions to use
xcb_sync_*.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-12-30 07:06:47 +00:00
Yuxuan Shui 51d03132bf
A bit more xcb conversion
None -> XCB_NONE
Window -> xcb_window_t
Atom -> xcb_atom_t

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-12-27 20:45:38 +00:00
Yuxuan Shui f41765fca5
Refactor setting the default winopts
Move filling winopts with default values to after command line options have
been parsed, not after parsing the config file. This is more intuitive.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-12-24 19:57:16 +00:00
Yuxuan Shui cb7d852b0f
Clean up options/config file parsing
* 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>
2018-12-21 17:21:52 +00:00
Yuxuan Shui 8f05b03411
Move the initialization of wintype options into common function
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>
2018-12-04 16:29:32 +00:00
Yuxuan Shui f97cf48865
Clean up the wintype option logic
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>
2018-12-04 15:13:08 +00:00
Yuxuan Shui ee318582f5 Sort out license problems
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.
2018-10-03 22:14:51 +01:00
Yuxuan Shui 28a2cc62fa Convert XfixesRegion to pixman region
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>
2018-09-30 14:18:33 +01:00
Uli Schlachter 539d62ca93 Port from xrender to xcb-render
Signed-off-by: Uli Schlachter <psychon@znc.in>
2018-09-27 18:14:44 +02:00
Uli Schlachter 0a98ef79ef Fix build with NO_LIBCONFIG=1
This got broken in commit fcef5e706d.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2018-09-27 17:10:43 +02:00
Yuxuan Shui 571a6cf15f Enable everything OpenGL when using OpenGL
Remove finer grained macro definitions, just enable everything OpenGL
when we are using OpenGL.
2018-09-10 13:46:24 +01:00
Yuxuan Shui fcef5e706d Some cleanup work
* Remove NO_C2 option
* Split configuration related functions into their own file
* Drop support for libconfig < 1.4
* Fix dependencies in Makefile
2018-09-10 13:46:05 +01:00