Commit Graph

1118 Commits

Author SHA1 Message Date
Yuxuan Shui 20e60a87fa
recheck_focus doesn't need to return anything
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-05-24 22:40:36 +01:00
Yuxuan Shui 9c50bc58cb
core: don't refresh image when not using experimental backends
Fixes #176

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-05-24 00:12:42 +01:00
Yuxuan Shui 44bea480b2
Fix build on gcc < 8
Fixes #175

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-05-24 00:07:01 +01:00
Yuxuan Shui 094f00a048
Refresh stale image in critical section
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-05-22 22:38:22 +01:00
Yuxuan Shui b5da914920
Mark xcb_generate_id deprecated in compton
x_new_id is preferred since it checks for error.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-05-21 23:23:42 +01:00
Yuxuan Shui 89c4527264
Update README
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-05-21 22:16:40 +01:00
Yuxuan Shui 357146d1c1
README: Call for testers
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-05-21 22:16:09 +01:00
Yuxuan Shui b9a3b67f9c
new backend: xrender: fix INVER_COLOR_ALL
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-05-21 22:15:38 +01:00
Yuxuan Shui 294aae11ff
Fix xrender APPLY_ALPHA
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-05-21 20:22:20 +01:00
Yuxuan Shui 488db11f14
make sure backend_data is not null
... before assigning to backend_data->ops in initialize_backend()

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-05-21 20:15:35 +01:00
Yuxuan Shui 3cabba6161
gl_common: don't use GL4 feature
glGetIntegerv(GL_NUM_EXTENSIONS) is only available since GL4.

(However glGetStringi(GL_EXTENSIONS) is available since GL3)

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-05-21 20:15:35 +01:00
Yuxuan Shui 2d50d32bf7
new backend: glx: multiply color in APPLY_ALPHA
Because we use pre-multiplied alpha.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-05-21 20:15:35 +01:00
Yuxuan Shui 80c7b2f7ec
new backend: glx: implement IMAGE_OP_APPLY_ALPHA
Slight change to the backend_operations::fill interface.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-05-21 20:15:35 +01:00
Yuxuan Shui 18b1fc95ff
new backend: glx: reduce code duplication
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-05-21 20:15:35 +01:00
Yuxuan Shui 45ead409b5
new backend: glx: fix off-by-1 in blur shader generation
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-05-21 20:15:35 +01:00
Yuxuan Shui 86f4d73c22
new backend: gl_common: add support for decoupling lazy copied images
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-05-21 20:15:35 +01:00
Yuxuan Shui b91888b0a3
new backend: glx: trivial refactoring
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-05-21 20:15:34 +01:00
Yuxuan Shui e894105e7b
atom: fix memory leak
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-05-21 20:15:34 +01:00
Yuxuan Shui 7ed9f2884f
Fix build 2019-05-21 20:15:34 +01:00
Yuxuan Shui 18a62537ec
Add missing header file 2019-05-21 20:15:34 +01:00
Yuxuan Shui cdb24ec99c
common.h: cleanup, cont.
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-05-21 20:15:34 +01:00
Yuxuan Shui 16ea51bbc1
common.h: more clean up
Remove more unused stuff.

Also removed session::xinerama_scrs, since all the information we need
is covered by xinerama_scr_regs. Convert uses of xinerama_scrs to use
xinerama_scr_regs.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-05-21 20:15:34 +01:00
Yuxuan Shui a409913c5f
common.h: remove cxfree
Apparently XFree does take NULL.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-05-21 20:15:34 +01:00
Yuxuan Shui 939f2fb602
common.h: general clean up
Remove unused functions and definitions. Move some macros into the files
they belong.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-05-21 20:15:34 +01:00
Yuxuan Shui e330464126
core: acquire X compositor selection first
Don't do anything with the overlay window with out the compositor
selection.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-05-21 20:15:33 +01:00
Yuxuan Shui c6a4928a45
atom: cache result of get_atom
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-05-21 20:15:33 +01:00
Yuxuan Shui 76c484885d
cache: cache_get can now return error
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-05-21 20:15:33 +01:00
Yuxuan Shui 93e4a53d48
cache: fix memory leak, add missing function
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-05-21 20:15:33 +01:00
Yuxuan Shui c08fd08ea4
Add a general key-value caching framework
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-05-21 20:15:33 +01:00
Yuxuan Shui be673f93c6
backend: add interfaces for readiness reporting
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-05-21 20:15:33 +01:00
Yuxuan Shui f50428a18b
core: reuse handle_new_window for pre-existing windows
Reduce code duplication, also handle_new_window handles damage of mapped
windows properly.

Fixes #160

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-05-21 20:15:33 +01:00
Yuxuan Shui 1b00eeaf60
core: mark pre-existing window as damaged
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-05-21 20:15:33 +01:00
Yuxuan Shui a40fdb86e1
core: unmap overlay window when we first acquire it
It used to be unmap when we receive its MapNotify, but now since we discard
events received before we grab X server, that event it lost. But it
turns out we can just unmap it when it's first created, no need to wait
for the MapNotify.

Partially fix #160

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-05-21 20:15:32 +01:00
Yuxuan Shui ad8211e341
event: handle reparent to the same parent
When a window is reparented to the same parent again, we should just
move it to the top of the stack, instead of add it again.

Also a slight refactor restack_win.

Fixes #164

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-05-21 20:15:32 +01:00
Yuxuan Shui cfbd1819ed
core: only grab X server when there indeed is new windows
Shouldn't grab X server for nothing.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-05-21 20:15:32 +01:00
Yuxuan Shui 46b8eb8d4d
core: handle configure notify of unmanaged window
Important for window stacking.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-05-21 20:15:32 +01:00
Yuxuan Shui 9ed1b985c5
core: don't try rebinding the window image when unredirected
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-05-21 20:15:32 +01:00
Yuxuan Shui efe63f5380
fix nogl build
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-05-21 20:15:32 +01:00
Yuxuan Shui 468fb637b6
new backends: xrender: fix memory leak
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-05-21 20:15:32 +01:00
Yuxuan Shui f93f697759
Remove several unnecessary experimental_backends check
Window flags can be set whichever backend we use, we will ignore then in
paint_preprocess. free_paint can be called whichever backend we use,
they just do nothing if we use experimental backends.

Others should rather just check if backend_data is NULL.

Making the code slightly more understandable, also making the eventual
removal of these checks easier.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-05-21 20:15:31 +01:00
Yuxuan Shui 8e5210cb9c
new backend: glx: use glFinish instead of glXWaitGL
The API document claims they achieve the same thing, apparently not.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-05-21 20:15:31 +01:00
Yuxuan Shui c55088944a
new backend: glx: use glFinish/glXWaitGL if not on NVIDIA
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-05-21 20:15:31 +01:00
Yuxuan Shui b35bfd07d1
backend: driver: fix string out-of-bound read
libxcb doesn't null terminate strings.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-05-21 20:15:31 +01:00
Yuxuan Shui 197e9dc866
auto enable sync fence for NVIDIA driver users
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-05-21 20:15:31 +01:00
Yuxuan Shui 685a583f84
backend: add preliminary support for driver detection
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-05-21 20:15:31 +01:00
Yuxuan Shui a2d0d5c826
xrender: move into its own folder
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-05-21 20:15:31 +01:00
Yuxuan Shui 5069193893
core: mark newly created window as damaged
Damage could have already happened at the time we call fill_win on a new
window. It's too difficult, or impossible, for us the find out if that
happened. So just blindly mark window as damaged.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-05-21 20:15:31 +01:00
Yuxuan Shui d4fde6a392
core: wait for the result xcb_grab_server before doing anything
Make sure X grab server is finished before calling x_discard_events in
session_init. Otherwise x_discard_events won't be able to discard all of
the events that were sent before we grab the server.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-05-21 20:15:30 +01:00
Yuxuan Shui 3d2217a112
event: promote several logs to log level debug 2019-05-21 20:15:30 +01:00
Yuxuan Shui 0753eaacf8
Map newly created window in handle_new_window
A window might be mapped before we had the chance to start managing it.
So check to see if we should map a window after we call fill_win on it.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-05-21 20:15:30 +01:00