Commit Graph

765 Commits

Author SHA1 Message Date
Yuxuan Shui 8bc052929e
Enable -Werror in CI
And fixes some warnings.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-12-19 23:41:58 +00:00
Yuxuan Shui 9d115a1cc2
Use meson's c_std instead of -std=
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-12-19 23:37:45 +00:00
Yuxuan Shui e58cbf8add
Convert non-mandatory attributes to macros
They're shorter and more portable.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-12-19 20:50:02 +00:00
Yuxuan Shui 5f57cb41f9
A bit more compiler dependent macros
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-12-19 20:36:05 +00:00
Yuxuan Shui 46b50b4b1a
Some code reuse in .circleci/config.yml
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-12-17 00:59:29 +00:00
Yuxuan Shui 7901b86024
Make sure vsync arrays are big enough
Fix array boundary overrun

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-12-17 00:51:27 +00:00
Yuxuan Shui eabe2b5bb8
Explicitly cast X sequence number
Fix an undefined behavior.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-12-17 00:51:27 +00:00
Yuxuan Shui a6b63cd035
Build with more config combinations
Also add missing dependency to readme

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-12-16 16:56:54 +00:00
Yuxuan Shui 2f4b055fa8
Add initial CI
Build test only for now.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-12-16 16:25:06 +00:00
Yuxuan Shui 50ea3617ef
Move some deinitialization to render.c
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-12-16 03:00:56 +00:00
Yuxuan Shui e7a15ba846
Format changes
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-12-16 02:50:39 +00:00
Yuxuan Shui 404a6b47ad
Move presum_gaussian to render.c
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-12-16 02:49:41 +00:00
Yuxuan Shui a48e1f65a9
Fix building with opengl, again
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-12-16 02:48:02 +00:00
Yuxuan Shui 9ce1387f52
Move a few more functions into render.c
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-12-16 00:53:54 +00:00
Yuxuan Shui e29d9510ed
Remove a debug message
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-12-16 00:52:45 +00:00
Yuxuan Shui baeb4572ff
Move rendering related functions out of compton.c
Moved:
* Blur kernel related functions to kernel.c
* Vsync related functions to vsync.c
* paint related functions to render.c

This will make the `split-backend` branch easier to rebase.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-12-16 00:50:46 +00:00
Yuxuan Shui 85c5d34ce1
Add missing CONFIG_OPENGL check
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-12-15 20:09:49 +00:00
Yuxuan Shui e6871c9251
Update README.md
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-12-15 19:57:57 +00:00
Yuxuan Shui 94b1bc0387
Use libxdg-basedir for finding config files
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>
2018-12-15 19:53:16 +00:00
Yuxuan Shui 68873efaa2
Move likely/unlikely to compiler.h
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-12-15 19:14:01 +00:00
Yuxuan Shui b73dce1d6d
Replace mstrcpy, mstrncpy with strdup, strndup
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-12-15 19:07:14 +00:00
Yuxuan Shui b8912fa749
Use checked allocation everywhere
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-12-15 18:57:46 +00:00
Yuxuan Shui acb81bc9a9
Add log.h to files that need it
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-12-15 17:53:17 +00:00
Yuxuan Shui 0cebbc370a
Function movements
* 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>
2018-12-15 17:43:36 +00:00
Yuxuan Shui c2c16fb8a1
Tiny clean up of meson.build
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-12-15 16:40:00 +00:00
Yuxuan Shui b5d135df82
Man page improvements
* 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>
2018-12-15 16:36:42 +00:00
Yuxuan Shui dcf1b1fcf4
Update urls in man pages
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-12-15 16:05:33 +00:00
Yuxuan Shui 0b0c7a751e
Update CONTRIBUTORS
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-12-15 14:59:43 +00:00
yshui 61b637f4ae
Merge pull request #66 from Streetwalrus/vsync
Improve swap-controlled vsync for mesa
2018-12-15 13:47:40 +00:00
Dan Elkouby 6195422c66 Swap control only works with OpenGL 2018-12-15 11:22:38 +02:00
Dan Elkouby e2182bb00b Work around mesa's default-on swap control 2018-12-14 19:25:05 +02:00
Dan Elkouby de1cce21ba Merge opengl-{,m}swc vsync methods
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).
2018-12-14 19:24:03 +02:00
Yuxuan Shui f94c799e02 Remove cmake leftovers
Thanks @The-King-of-Toasters

Fixes #65

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-12-14 17:13:30 +00:00
Yuxuan Shui 0899a9689e
Remove unused variable in paint_preprocess
And fix a memory leak caused by it.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-12-09 21:00:32 +00:00
Yuxuan Shui 345bacf3b3
Convert wid_get_prop to xcb
This should give us sane item size, i.e. the item has the same number of
bits their format says they have.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-12-09 20:54:16 +00:00
Yuxuan Shui 8805cfa986
Move winprop_t to win.h
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-12-09 20:25:09 +00:00
Yuxuan Shui 733d5dcf54
Fix pointer types of winprop_t
Foolish of me to assume the returned window property items have the same
number of bits their format says they have.

Apparently, format = 32 means the return items are 64 bits long (on
64-bit machines).

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-12-09 20:19:13 +00:00
Yuxuan Shui dffde065b1
Make the shadow actually gaussian
The old shadow kernel formula is not "wrong" per se, as the only judge
is if it looks good. However, the formula used is not really gaussian.
Also, the kernel size calculation doesn't really make sense to me.

This commit change the kernel formula to actually use a gaussian
distribution. As far as I can tell, there is no perceivable difference.
Except now the effective shadow radius is smaller for the same config.

Also, made that part of code a bit more mordern.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-12-09 02:07:08 +00:00
Yuxuan Shui da3df75a8c
Make sure the vsync methods are really available
libglvnd seems to return a pointer to a function that does NOTHING
for things the backing driver doesn't support.

So we check if the extension is actually advertised before using it.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-12-08 18:22:59 +00:00
Yuxuan Shui 8114ec4c79
Small improvement to man page
Fix grammar in documentation of redir-ignore

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-12-08 17:46:35 +00:00
yshui 90e1974d1d
Merge pull request #60 from yshui/redir-ignore
Add wintype option `redir-ignore`.
2018-12-05 20:54:41 +00:00
Yuxuan Shui f83eb79c05
Add wintype option `redir-ignore`.
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>
2018-12-04 16:36:49 +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 94d500bd53
Update manpage to reflect wintypes logic change
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-12-04 15:29:37 +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 a3f753105f Don't allocate libev struct separately
Elimiate some annoying types.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-11-27 00:32:08 +00:00
Yuxuan Shui 531aafabb5 Fix SIGUSR1 handling
Calling ev_break() in a signal handler doesn't work. Instead, we setup a
libev ev_signal handler for this.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-11-26 23:57:55 +00:00
Yuxuan Shui b89dadec40 Fix a wrong type
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-11-26 23:57:55 +00:00
Yuxuan Shui 2827a020a4 Handle SIGINT
Exit gracefully so sanitizer can do their jobs.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-11-26 23:57:55 +00:00
Yuxuan Shui 90a4b201bd Re-word some of the comments
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-11-26 23:57:55 +00:00