Yuxuan Shui
48687b985d
Make potentially window destroying functions take simple pointers
...
Instead of pointer to pointer. The two level of pointers were used to
inform the caller the window has been destroyed (pointer set to NULL).
Now, destruction of windows are now signaled by the return value, which
is marked `must_use`.
Problem with taking pointer to pointer is that they tends to pollute the
function signatures a little bit. And we are not using it well anyways.
A lot of the callers passes pointers to local variables to those
functions, so the information about window destruction doesn't actually
bubble up. So, we switch to use just one level of pointers instead.
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-09-16 23:14:03 +01:00
Yuxuan Shui
127b1ac3a4
win: remove some unreachable code
...
finish_destroy_win has unreachable code after a return statement
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-09-16 22:46:25 +01:00
Yuxuan Shui
1780f63914
backend/driver.h: add comments about NVIDIA quirks
...
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-09-16 22:44:09 +01:00
Yuxuan Shui
b2ff4eb2c9
compiler.h: add popcount
2019-09-07 19:11:04 +01:00
Yuxuan Shui
4e915837a4
core: track whether server is grabbed
2019-09-07 19:10:58 +01:00
Yuxuan Shui
02139b7c9f
Fix type in log message
...
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-08-27 22:15:36 +01:00
Yuxuan Shui
04520368f6
glx: clarify a comment
...
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-08-11 03:24:02 +01:00
Yuxuan Shui
0771234ee2
More header fixes
...
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-08-10 15:31:23 +01:00
Yuxuan Shui
2fbb45dcd7
win: remove unused member of struct win
...
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-08-10 01:47:05 +01:00
Yuxuan Shui
306f5e8b75
win.h: remove unused prototypes
...
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-08-10 01:44:27 +01:00
Yuxuan Shui
dd21806662
core: shrink the critical section in session_init
...
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-08-10 01:23:11 +01:00
Yuxuan Shui
0ba7761bd5
Untangle headers
...
Thanks, clang -fmodules.
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-08-10 00:56:26 +01:00
Yuxuan Shui
fae30d46e7
core: don't initialize dbus in critical section
...
grabbing X server stops the dbus daemon in some cases, causing compton to
hang in dbus initialization.
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-08-09 23:34:37 +01:00
Yuxuan Shui
c719804fb1
backend: dummy: initialize backend_base properly
...
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-08-09 23:33:01 +01:00
Yuxuan Shui
4dc5a04735
core: fix background not blurred under transparent windows
...
When a window has 0 opacity, it's rendering is skipped completely. Thus
its background isn't blurred.
This commit fixes that.
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-08-04 23:15:10 +01:00
Yuxuan Shui
9b419ce37d
core: fix assertion failure when blur context failed to initialize
...
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-08-04 17:55:39 +01:00
Yuxuan Shui
8eb9d07fa8
Add dummy backend
...
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-08-04 17:52:45 +01:00
Yuxuan Shui
d702fc9365
Preparation for dummy backends
...
Dummy backends are backends that doesn't render anything on to the
screen or the target window. But they are still be useful for debug
purposes, and can be useful for other things too.
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-08-04 16:46:09 +01:00
Yuxuan Shui
8168c38d4f
core: no need to unredirect the registration window
...
This window is invisible anyway, whether it's redirected should be
inconsequential.
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-08-04 16:41:28 +01:00
Yuxuan Shui
ddde118c69
core: check if a chosen backend is available
...
Error out instead of segfaulting when the chosen backend is not
available.
Fixes #210
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-08-01 21:23:56 +01:00
Yuxuan Shui
1f80c8dc16
render: don't free blur_kerns_cache when it's not used
...
blur_kernel_count could be none zero when user set a blur kernel but
didn't enable blur. In that case deinit_render will try to free
elements of blur_kerns_cache, causing a segfault because
blur_kerns_cache is never allocated.
Fixes #209
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-07-31 23:52:31 +01:00
Yuxuan Shui
6cb5f9711e
core: deregister xerror handler in session_destroy
...
xerror handler might be called during XCloseDisplay, at which point
session_t is already destroyed, causing a segfault.
Ping #209
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-07-30 06:40:24 +01:00
Yuxuan Shui
d7415fcf2e
new backends: blur background before rendering shadow
...
Otherwise the blurred background will have a darker edge because the
shadow is blended in.
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-07-29 21:19:06 +01:00
Yuxuan Shui
5da71e6bfd
core: add a TODO
...
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-07-27 17:08:47 +00:00
Yuxuan Shui
6ac50626ef
win: don't create shadow image when not requested
...
win_set_shadow tries to create shadow image even when shadow_new is false, this
is incorrect.
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-07-27 00:02:44 +01:00
Yuxuan Shui
a229f34eaa
new backend: fix background blur of window with opacity set
...
Only render blur with transparency when window is fading in/out.
Otherwise, a window with a set opacity will always have a completely
blurred background.
Fixes #198
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-07-26 23:43:28 +01:00
Yuxuan Shui
79fc36b3e3
win: don't change window OPACITY property
...
Don't override the OPACITY property set by the user on the window.
Fixes #134
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-07-26 22:29:42 +01:00
Yuxuan Shui
3434ea25f4
new xrender: fix nothing gets rendered without vsync
...
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-07-26 20:25:17 +01:00
Yuxuan Shui
c7bb6b0fe3
Clarify some of the backend interface functions
...
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-07-26 18:32:39 +01:00
Yuxuan Shui
e3b93a4f84
Additional blur artifact fix
...
There were still some artifacts left when multiple semi-transparent
windows are stacked on top of each other.
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-07-26 18:28:22 +01:00
Yuxuan Shui
0109fe181e
gl_common: fix memory leak in _gl_fill
...
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-07-26 03:53:24 +01:00
Yuxuan Shui
4772103334
Remove some unused members of session_t
...
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-07-26 03:39:01 +01:00
Yuxuan Shui
357968c815
options: remove a spurious warning
...
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-07-26 02:44:42 +01:00
Yuxuan Shui
d37a4136ee
new xrender: implement partial updates
...
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-07-26 02:31:45 +01:00
Yuxuan Shui
5a861d5d6a
gl_common, new glx: implement partial updates
...
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-07-26 02:22:05 +01:00
Yuxuan Shui
06dba4b196
backend: do partial updates
...
Although the functionality is not implemented by any backends yet.
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-07-26 02:05:06 +01:00
Yuxuan Shui
f86d6b7cbd
backend: update present interface for partial updates
...
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-07-26 02:05:00 +01:00
Yuxuan Shui
bc3ca92e04
gl common: render into a texture
...
Instead of rendering into the back buffer, render into a intermediate
texture.
This is a preparation for partial screen updating, which is necessary to
eliminate artifacts visible when using blur and use-damage together.
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-07-26 01:20:11 +01:00
Yuxuan Shui
3d84f3f92a
gl_common: fix type mismatch when calling glVertexAttribPointer
...
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-07-26 01:19:55 +01:00
Yuxuan Shui
8dae86a8cf
dbus: log resets
...
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-07-25 21:32:59 +01:00
Yuxuan Shui
159a45b9e9
core: root_image freeing shouldn't be in a loop
2019-07-25 21:25:43 +01:00
Yuxuan Shui
80d77b4ee8
core: don't reuse X connection across resets
...
In theory, it should be fine. But it causes mesa to stuck in
xcb_wait_for_special_event, indicating X connection setup issues.
Instead of investigating what went wrong in mesa, I choose to apply this
simple fix.
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-07-25 21:15:47 +01:00
Yuxuan Shui
f9703cdc04
dbus: fix resetting
...
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-07-25 21:01:40 +01:00
Yuxuan Shui
79b135dccc
Fix warnings when opengl is disabled
...
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-07-25 02:52:37 +01:00
Yuxuan Shui
72cedea5a3
config: fix warning when config_file is disabled
...
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-07-25 02:46:46 +01:00
Yuxuan Shui
9194506696
core: destroy debug window in session_destroy
...
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-07-25 02:38:03 +01:00
Yuxuan Shui
5094400ab7
core: don't deinit tls logger in session_destroy
...
tls logger is initialized by main(), so only main() could deinit it.
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-07-25 02:37:43 +01:00
Yuxuan Shui
bb756b2238
Fix compiler warning about unused parameters
...
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-07-25 02:27:02 +01:00
Yuxuan Shui
62878d7c57
gl_common: use a dummy pass to unify blur code paths
...
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-07-25 00:36:42 +01:00
Yuxuan Shui
4c9ded837f
new backend: add interface for query blur size
...
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-07-24 23:27:51 +01:00