Commit Graph

899 Commits

Author SHA1 Message Date
Yuxuan Shui 02ddf96fd5
Remove leftover CONFIG_XINERAMAs
Fixes #118

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-02-19 20:48:31 +00:00
Yuxuan Shui bb8fd08b5b
Fix a compiler complaint
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-02-18 21:32:49 +00:00
Yuxuan Shui 2a41847aa6
Make xinerama mandatory
Fixes #116

Also tweaks the usage message a bit.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-02-18 21:05:12 +00:00
Yuxuan Shui b2750b26e0
Rectangle kernels
Replace conv::size with conv::{w,h}.

Shadow kernels are still squares, though.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-02-17 21:58:43 +00:00
Yuxuan Shui cea010afec
Ignore the map/unmap of input only windows
Fixes some misleading warning messages.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-02-17 18:27:19 +00:00
Yuxuan Shui 635351c820
Remove win::*_last
A side effect of this is that some window properties are allowed to
change during fade-in/out. (e.g. window background can become blurred
during window fade out if window properties changed so blur is requirired).
But it is unclear what is the expected behaviour in this case anyway, so we
choose the one that is simpler to implement.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-02-17 18:12:41 +00:00
Yuxuan Shui ed4202b52f
Fix memory leaks
Restrict the use of ps_g to xerror() and main().

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-02-17 16:59:22 +00:00
yshui ecb3050eaa
Merge pull request #111 from yshui/winstate-refactor
Window state tracking refactor
2019-02-17 16:56:27 +00:00
Yuxuan Shui e0d394595b
Remove session_t::fade_running
It is used more as a out variable for paint_preprocess, so make it that.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-02-17 16:48:41 +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 e109bee380
Fix some clang-analyzer complains
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-02-13 04:23:54 +00:00
Yuxuan Shui 7cdc0aedee
log.h needs to export compiler.h
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-02-13 04:18:32 +00:00
Yuxuan Shui bb7466fc68
trace/debug logs are unlikely
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-02-13 04:11:41 +00:00
Yuxuan Shui 2d56b77853
Update man page to reflect changes in command line flags
Fixes #112

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-02-13 02:11:41 +00:00
Yuxuan Shui 60aa36b7af
Failure of config file parsing is a hard failure
compton will now quit if it fails to parse the config file.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-02-13 02:05:01 +00:00
Yuxuan Shui 7a21cef9a4
Handle SIGINT through libev
Handle SIGINT using libev's ev_signal handler, instead of using
sigaction().

Fixes #64. But compton might miss signals when it's not in the main loop
(e.g. when compton is reset), and thus not exit "clearly". It should
cause any real problem though, so we don't care.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-02-11 23:13:39 +00:00
Yuxuan Shui df69749804
Don't remove stderr logger if it fail to create
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-02-11 22:58:16 +00:00
Yuxuan Shui fc2353d186
Tolerant logger creation failure
Fix resetting a background compton

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-02-09 02:49:16 +00:00
Yuxuan Shui 39faac0f83
Blacklist more glx.h prototypes just in case
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-02-09 00:52:45 +00:00
Yuxuan Shui 136ce7c9e8
Prevent GL/glx.h from defining prototypes
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-02-09 00:43:31 +00:00
Yuxuan Shui 4c99ecfde4
Fix compile without opengl
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-02-09 00:16:47 +00:00
Yuxuan Shui 7e9d1c6442
Condense GLX extension lookup
Put them all into one function, and move the function pointers out of
glx_session_t, making them global variables (because them don't change
after initialized). Remove the function pointer typedefs and replace
them with the ones in glxext.h

We also only lookup the functions once per a lifetime of compton.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-02-09 00:14:32 +00:00
Yuxuan Shui 1a327b06ab
Fix abort because we used log too early
Can't use log in get_early_config.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-02-08 22:46:28 +00:00
Yuxuan Shui 343140f845
Reuse glx_has_extension for old backend
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-02-08 22:34:53 +00:00
Yuxuan Shui edb8b38eef
Tile root pixmap in the glx backend
In X, background pixmap is tiled (meaning they are repeated to filled
the window) by default. So, in the glx backend, we mimic this behavior
by binding the background pixmap of the root window (aka, the wallpaper)
to texture that repeats.

Fixes #107

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-02-08 21:48:39 +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 fec43acfaa
Add missing headers
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-02-07 22:47:42 +00:00
Yuxuan Shui 33c1cd439b
Fix memory leak of dbus service names
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-02-07 22:47:32 +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 2867ac7a1c
Remove unused screenshot code
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-02-07 22:16:32 +00:00
Yuxuan Shui 68c77cd7d8
Add log_remove_target
Don't need to deinit+init struct log any more just to switch log target
:)

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-02-07 21:50:20 +00:00
Yuxuan Shui 049cc94e7a
Coding style change
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-02-07 21:37:13 +00:00
Yuxuan Shui 22bc79369e
Review the use of XFlush and xcb_flush
Replace most of XFlush with xcb_flush.

Also, in a lot of places, XFlush is used as if it is XSync. Replace
those cases by using xcb's _checked version of functions and
xcb_request_check.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-02-07 01:11:13 +00:00
Yuxuan Shui 856ad4b230
Wrap root window background prop check
It might be reused by the backends.

Depends on what the backend API ends up look like.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-02-07 00:34:48 +00:00
Yuxuan Shui 7d00b89364
x_get_pictform_for_visual should return const *
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-02-07 00:22:16 +00:00
Yuxuan Shui aa9c439cc6
Improve the interface of glx_find_fbconfig
Remove the dependence of xcb_render types in glx.h

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-02-07 00:04:43 +00:00
Will Dietz 345009c677 meson.build: bump project version 2019-02-04 09:28:31 +00:00
Yuxuan Shui f19766f15a
Fix FBConfig cost calculation
Double buffering only doubles the color buffer, not the depth and
stencil.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-02-03 19:33:31 +00:00
Yuxuan Shui 2263bab2ff
Consider buffer size and double buffering as well
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-02-03 19:15:30 +00:00
Yuxuan Shui 519bf8500b
Prefer FBConfig with smaller depth + stencil buffer
Reduce GPU memory usage to what it was before fix-fbconfig.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-02-03 19:06:33 +00:00
Yuxuan Shui 39b612a8a4
Delete irrelevant comments
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-02-03 18:53:28 +00:00
Yuxuan Shui b1d8687b31
Add copyright notice to backend/**
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-02-03 18:47:36 +00:00
yshui 6a5ad609ba
Merge pull request #104 from yshui/fix-fbconfig
Fix fbconfig lookup
2019-02-03 18:43:58 +00:00
Yuxuan Shui 388a7f3ad4
Fix leaking of root_tile FBConfig
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-02-03 18:41:47 +00:00
Yuxuan Shui 24370f44e6
Cache FBConfig used for shadows
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-02-03 18:41:47 +00:00
Yuxuan Shui 8922312e42
Refactor FBConfig lookup
Background: To bind a Xorg window content to a OpenGL FBConfig, which
has to match the color format the Xorg window is using.

Previously, compton just find a FBConfig that has the same depth. This
led to chjj/compton#477, which has been fixed by a ugly hack.

The commit refactor the lookup mechanism to take as much into
consideration as we reasonably can. Hopefully preventing similar
breakages in the future.

Also, some code sharing between the old and new glx backend.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-02-03 18:41:47 +00:00
Yuxuan Shui 7ac351e5b5
Move some default_* functions to backend_common.c
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-02-03 18:41:02 +00:00
Yuxuan Shui b061789a84
Add helper function x_get_visual_depth
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-02-03 16:49:04 +00:00
yshui 386f5fb8c6
Merge pull request #105 from yshui/no-session_t-season1
Most of the x_* functions don't need session_t
2019-02-03 16:03:59 +00:00
Yuxuan Shui 17c8517abc
Most of the x_* functions don't need session_t
Replace session_t parameter with xcb_connection_t if that's the only
thing needed.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-02-03 15:59:31 +00:00