Commit Graph

777 Commits

Author SHA1 Message Date
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
yshui 3a9ec744fc
Merge pull request #57 from yshui/refresh0
Don't delay update when refresh rate is not available
2018-11-26 17:52:39 +00:00
Yuxuan Shui 010a0c34ca Don't delay update when refresh rate is not available
Fix a divide by zero in delay time calculation.

Fixes #56
2018-11-26 16:53:57 +00:00
Yuxuan Shui 7d990fef88 Update issue template 2018-11-26 15:46:04 +00:00
yshui b86f47e965
Merge pull request #48 from yshui/alpha-step
Support all alpha values
2018-11-19 12:44:13 +00:00
Yuxuan Shui 0a6f48dba2 Support all alpha values
Remove alpha_step, and support all 256 alpha values.

1 pixel pictures don't really use that many resources.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-11-19 12:43:46 +00:00
yshui c389a1335d
Merge pull request #46 from yshui/full-shadow
Add per window type option full-shadow
2018-11-19 12:31:11 +00:00
Yuxuan Shui f834cf20ae Print deprecation message for --glx-fshader-win
No functionality is removed in this commit.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-11-11 19:38:58 +00:00
yshui a61b877e22 Merge pull request #52 from yshui/dri2-hack
Workaround the incompatibility between DRI2 and xcb

Fixes #33 #34 #47
2018-11-11 13:13:00 +00:00
Yuxuan Shui bcab5d1518 Workaround the incompatibility between DRI2 and xcb
When using DRI2, Mesa uses XESetWireToEvent to hook into Xlib's event
handling loop, so it can get notified when certain DRI2 event happens,
which is crucial to the normal functioning of GLX.

When xcb is owning the event queue (meaning libxcb is doing all the
event handling), those functions registered by Mesa will never be
called, thus GLX will malfunction, leading to screen flickers or visual
artifacts.

This commit uses a hack from Qt to manually call those functions in
compton.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-11-10 22:25:41 +00:00
yshui 47377df04a
Merge pull request #51 from yshui/glx-sync-removal
Remove GLX sync fence code
2018-11-10 22:25:14 +00:00
Yuxuan Shui 03ff094f75 Remove GLX sync fence code
It was never enabled in the old version of compton anyway.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-11-10 22:16:30 +00:00
Yuxuan Shui 45a260b433 Print warning messages for multipass blur
Multipass blur is not properly implemented for xrender backend. There is
visible artifacts when it is used. And it is quite difficult to
implement correctly and efficiently for the xrender backend.

Print a warning message for multipass blur so we can survey whether it
is actually been used.

No functionality is removed in this commit.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-11-10 14:57:41 +00:00
yshui d0e824ea6f
Merge pull request #49 from yshui/debug-40
Set clip region on the target picture
2018-11-10 12:56:55 +00:00
Yuxuan Shui 683cda0b91 Set clip region on the target picture
Setting it on the target buffer picture has no effect. Fix performance
problem when using xrender with virtual box.

Fixes #40

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-11-10 12:55:08 +00:00
Yuxuan Shui 46d162cec9 Print useful message when clear-shadow is used
Points the user to the full-shadow per window type option.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-11-09 21:04:22 +00:00
Yuxuan Shui 0dcb0e0dc6 Add per window type option full-shadow
When this option is enabled for a window type, shadow will be drawn in
areas that are obscure by the shape of the window.

Useful when the given window type has parts of the window transparent,
and you want to have shadows in those areas.

Fixes #45

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-11-09 19:56:05 +00:00
Yuxuan Shui b18d46bcbd Revert "Remove xrender-sync and xrender-sync-fence"
This reverts commit 50e2259404.

Temporarily revert the removal until we have more information about this whole
thing.

Turns out a couple of drivers don't work properly without the sync fence,
including intel, llvmpipe and NVIDIA.

Although sync fence is needed, from the information I have gathered (looking
at old bug reports, protocol specifications, look at other compositors' code),
compton's usage of it is not proper. So we need to rewrite it in the future,
after we get more information from driver developers.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-11-08 18:07:18 +00:00
Yuxuan Shui ab7a2f1872 Ask for more info in issue template
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-11-05 18:15:36 +00:00
Yuxuan Shui 2b0b7435df Convert some Xlib constants to xcb
And remove some Xlib headers

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-11-04 18:58:05 +00:00
Yuxuan Shui 471f6f90ff Remove some unnecessary macros
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-11-04 18:54:37 +00:00
Yuxuan Shui 06abd7b041 Fix xr_glx_hybrid backend
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-11-04 13:49:55 +00:00
Yuxuan Shui 796b0e0448 Move private functions from compton.h to compton.c
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-11-03 22:38:33 +00:00
Yuxuan Shui 332a873729 Add --diagnostics option
It will cause compton to print out some rudimentary diagnostics.

Also small improvements of the meson.build.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-11-03 22:37:18 +00:00
Yuxuan Shui e142993bb5 Enable paint-on-overlay whenever possible
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-11-03 22:36:52 +00:00
Yuxuan Shui f65d7b2e64 Fix unsupported optimize attribute on clang
Use optnone instead, this does require a more recent clang though. In
general, just don't use -ffast-math.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-11-03 14:05:13 +00:00
Yuxuan Shui be09a9a835 Workaround compiling with -ffast-math
And add a compiler warning.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-11-02 13:57:42 +00:00
Yuxuan Shui 45e9530bcb Update bounding shape when a window is mapped
Fixes #35

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-11-01 21:06:40 +00:00
Yuxuan Shui 4f4201976d Fix signedness of x properties
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-11-01 11:12:46 +00:00
Yuxuan Shui 32e0b45255 Sanitize opacity data get from window props
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-10-31 23:18:10 +00:00
Yuxuan Shui d7b5104fd4 Remove poll.h include 2018-10-30 22:18:10 +00:00
Yuxuan Shui c0d7f9d915 Add damage when restacking windows
Interesting this problem only surface when using GTK applications on
KDE. Maybe on other WMs there are some other events after window
restacking that triggers repaint of the window.

Fixes #28

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-10-29 17:16:56 +00:00
Yuxuan Shui a312dcb3da Remove a debug message
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-10-29 13:36:48 +00:00
Yuxuan Shui 06d879251b Make building the docs optional
Fixes #29

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-10-29 11:55:10 +00:00
Yuxuan Shui 50e2259404 Remove xrender-sync and xrender-sync-fence
This was a dubious "fix" for a Nvidia driver problem. The problem was
never fully understood, and the then developers took a shotgun approach
and implemented xsync fences as a fix. Which somehow fixed the problem.
Again, I don't see any indication that the developers understood why
this "fix" worked.

(for details, see chjj/compton#152 and chjj/compton#181)

The driver problem should have been fixed almost 5 years ago. So this
shouldn't be needed anymore. In addition the way compton uses xsync fences
is apparently wrong according to the xsync spec (fences are attached to
screen, but compton uses them as if they were attached to drawables).

So, I will try removing it and see if anyone will complain. If there are
real concrete reasons why fences are needed, it will be brought back.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-10-28 23:36:55 +00:00
Yuxuan Shui 5694e75932 Fix build when opengl is disabled, again
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-10-28 23:09:42 +00:00
Yuxuan Shui 309a4cec79 Make monitor_repaint an option
This is a potentially useful feature for debugging the xrender backend,
so make it a commandline option rather than an obscure compiler flag.

Also this is only usable with xrender, for glx there are better tools
for debugging.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-10-25 23:32:10 +01:00
Yuxuan Shui 551d487836 Remove some unused parameters
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-10-25 23:32:10 +01:00
Yuxuan Shui f519ee53c1 Remove support of Xdbe
--dbe does not seem to have an effect on tearing, as noted in the old
manpage, and confirmed by my own testing.

So remove it, since it complicates the logic of painting.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-10-25 23:32:10 +01:00