Commit Graph

691 Commits

Author SHA1 Message Date
Yuxuan Shui 9b121447b9
Remove a couple of unwanted options
* -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>
2018-12-20 23:44:38 +00:00
Yuxuan Shui 9880245200
Move get_cfg and usage out of compton.c
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-12-20 23:12:38 +00:00
Yuxuan Shui 4ff9e810ff
Sort out the dbus function prototypes
* Moved dbus prototypes from common.h to dbus.h
* Removed private function prototypes from dbus.h
* Removed private macros from dbus.h
* Hide dbus types from common.h

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-12-20 23:12:27 +00:00
Yuxuan Shui eeb1f8f286
Remove Makefile
It hasn't been working for a while now.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-12-20 18:22:19 +00:00
yshui 729cffbf69
Merge pull request #68 from yshui/better-log
Convert print_errf in win.c and compton.c
2018-12-20 17:43:59 +00:00
Yuxuan Shui abeb294508
Remove printf_* macros
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-12-20 17:36:23 +00:00
Yuxuan Shui a6fef8e8fb
Convert printf_* from config.c and config_libconfig.c
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-12-20 17:35:45 +00:00
Yuxuan Shui d8198926dc
Convert printf_* in opengl.h
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-12-20 17:24:03 +00:00
Yuxuan Shui 24dd8ee120
Convert printf_* in vsync.c
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-12-20 17:19:41 +00:00
Yuxuan Shui 9b5db1f0aa
Convert printf_* in c2.c
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-12-20 17:16:20 +00:00
Yuxuan Shui 832601354a
Convert printf_* in render.c
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-12-20 17:03:27 +00:00
Yuxuan Shui b5b0f4af7f
Convert printf_errf/dbgf in several files
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-12-20 16:54:51 +00:00
Yuxuan Shui 3966491846
Convert printf_errf/dbgf in opengl.c
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-12-20 16:50:11 +00:00
Yuxuan Shui 22669889eb
Don't report allocation failure via logging
They will be reported by allocchk and will abort the program. There is
no point to log them.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-12-20 14:23:06 +00:00
Yuxuan Shui 1ea611c90e
Improved allocation failure reporting
Now it reports file and line number of the function too.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-12-20 14:19:10 +00:00
Yuxuan Shui 6f0daf8076
Add a writev interface for log targets
So some log targets can be more efficient and allocate less memory.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-12-20 04:45:07 +00:00
Yuxuan Shui 26807e74d9
Convert printf_errf in dbus.c
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-12-20 04:02:37 +00:00
Yuxuan Shui 2af0b48c7b
Convert printf_errf in common.h
And remove some unused functions.

And improve some error messages.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-12-20 03:56:37 +00:00
Yuxuan Shui 833eb966f1
Convert print_errf/dbgf in win.c and compton.c
And improve some of the log messages. Like, when compton exits because
of unsupported options, explain which options are causing compton to
quit.

Convert some debugging messages that are guarded behind ifdef's to log_trace,
so user don't need to re-compile to enabled them.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-12-20 03:56:31 +00:00
Yuxuan Shui 185c0ce97c
Guard log_printf in LOG macros with a log level check
So that the format arguments will only be evaluated if the log is
enabled by the log level. Allow us to add more expensive logs without
impact performance when they are not enabled.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-12-20 02:34:45 +00:00
Yuxuan Shui fc57c7b55b
Add a FATAL ERROR log level
For errors that cause compton to quit

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-12-20 02:02:08 +00:00
yshui 537831abfc
Merge pull request #67 from yshui/log
Add a logging framework
2018-12-20 01:31:48 +00:00
Yuxuan Shui d9409ae2c9
Add command line and config file option log-level
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-12-20 01:26:04 +00:00
Yuxuan Shui 1bcd7f2f7a
Add a simple logging framework
It's not very pretty now, but it will get better.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-12-20 01:02:56 +00:00
Yuxuan Shui 4040ad259d
Add compiler dependent macros for thread_local
Also add stdc-predef.h because __STDC_NO_THREADS__ is defined there.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-12-20 00:46:38 +00:00
Yuxuan Shui e19e78d974
Build test with different compiler in CI
Also set meaningful job names.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-12-20 00:27:42 +00:00
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