Commit Graph

1124 Commits

Author SHA1 Message Date
Yuxuan Shui bc0382d962
Remove usage of Xlib from x.c
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-12-30 06:05:39 +00:00
Yuxuan Shui 2e26c511c4
Fix allocation with 0 size
Thanks to the static analyzer

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-12-27 20:56:05 +00:00
Yuxuan Shui 669cbcdb14
Fix some static analyzer errors
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-12-27 20:47:58 +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 86e744345e
Fix build with gcc 6
gcc want _Noreturn to be the first thing in declaration.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-12-25 14:55:01 +00:00
Yuxuan Shui 311fa65840
Mark report_allocation_failure as noreturn
Silence an static analyzer warning

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-12-25 04:11:29 +00:00
Yuxuan Shui 1c0770dc66
Fix typo in man page
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-12-25 01:31:54 +00:00
yshui 9881e1168e
Merge pull request #80 from yshui/wintypes
Fix wintypes options handling
2018-12-24 21:40:12 +00:00
Yuxuan Shui 4f1dddd072
-C and -G *disables* shadow, not enabling them
Well, I made a mistake.

Fixes #79

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-12-24 19:58:25 +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 b434451abb
Lower x_print_error to log_debug
This information is only really useful for debugging anyway.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-12-22 14:29:26 +00:00
Yuxuan Shui 1b947658ff
Enable opengl by default
Was disabled by accident in 0c4b690b2

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-12-22 00:58:38 +00:00
yshui 068611e2e7
Merge pull request #76 from yshui/split-backends-part1
First step of split backend into modules
2018-12-22 00:53:47 +00:00
Yuxuan Shui 0c4b690b2b
First step of split backend into modules
This commit introduced a new, modular backend interface. The interface
is not very good, since I don't think I fully understand all the
requirements writing a backend have. But this is a good first step.

This commit also includes an initial xrender backend written using the
new interface, and some opengl backend related helper functions, which
are taken from the old opengl backend.

However, there is not integration with the core compton yet. compton
will still use the old backend code. This commit is here so we can get
the automated build test.

What is implemented in the new xrender backend:

* Windows with transparency
* Shadow
* Opacity
* Wallpaper (getting the root pixmap)
* Blur

Known problem with the xrender backend:

* It is slower

Things that still need to be figured out:

* What is the better way to add vsync to the new backends

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-12-22 00:50:25 +00:00
yshui d6a54c25e9
Merge pull request #75 from yshui/split-backend-prepare
Split backend prepare
2018-12-22 00:36:06 +00:00
Yuxuan Shui 2cf04544d8
Add some window related helper
For the backend refactoring.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-12-22 00:34:08 +00:00
Yuxuan Shui db5a78790c
Make make_shadow() public
Some the refactored backends can use it.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-12-22 00:30:45 +00:00
Yuxuan Shui af9d5ece00
Update CONTRIBUTORS
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-12-22 00:15:09 +00:00
yshui 7993758bf9
Merge pull request #74 from Avi-D-coder/next
Fix compile errors triggered by vsync-drm option
2018-12-22 00:13:52 +00:00
yshui 699d40fce9
Merge pull request #73 from yshui/x-helpers
Some new x helper functions
2018-12-21 23:57:46 +00:00
Yuxuan Shui 6c00d46d7a
Some new x helper functions
They should be useful for the refactored backends.

Renamed x_create_picture to x_create_picture_with_pictfmt.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-12-21 23:47:31 +00:00
Yuxuan Shui f8c86d51b3
Mark fallthrough switch case
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-12-21 23:04:51 +00:00
Yuxuan Shui e211c395fa
Append to log file, not overwrite
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-12-21 23:02:19 +00:00
Yuxuan Shui 8bb7027393
Fix memory leak in get_cfg
When setting --shadow-exclude-reg from both the config file and the
command line, one of the strings is not freed.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-12-21 22:59:28 +00:00
Yuxuan Shui 7915ade1be
Make --logpath work again
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>
2018-12-21 22:59:21 +00:00
Avi ד 09e372cc9d Fix vsync-drm 2018-12-21 17:25:24 -05:00
Yuxuan Shui fa98564040
Update README
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-12-21 21:23:45 +00:00
yshui 4dce20fab4
Merge pull request #72 from yshui/clean-opt2
Option/config parsing clean up
2018-12-21 17:23:47 +00:00
Yuxuan Shui c8a9f32b05
Add debug logging to get_atom
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-12-21 17:22:10 +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 ee2be09958
Rename argparse.* to options.*
Seems to be a more appropriate name.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-12-21 13:10:49 +00:00
yshui d2cc4e0243
Merge pull request #69 from yshui/arg
Clean ups
2018-12-21 00:01:48 +00:00
Yuxuan Shui 2a2958b68d
Split the first and second pass of get_cfg
They are not separate functions

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