Commit Graph

1158 Commits

Author SHA1 Message Date
Yuxuan Shui adc52798db
README: mentions how to specify header/library path
Closes #155

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-05-21 20:15:29 +01:00
Yuxuan Shui aee496aeff
build: look for libev via pkgconfig
FreeBSD has pkg-config files for libev

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-05-21 20:15:29 +01:00
Yuxuan Shui 41fd229230
build: check if std-predef.h exists
Fix build on FreeBSD / non-glibc systems

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-05-21 20:15:28 +01:00
Yuxuan Shui 85dba1f3c9
core: don't paint window with image errors
Previously we do window image update _after_ the to_paint checks.
Therefore the window image might failed to update after we decided to
paint it.

Do window image update before the checks.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-05-21 20:15:28 +01:00
Yuxuan Shui a6decc3a0f
list.h: remove restrict qualifier 2019-05-21 20:15:28 +01:00
Yuxuan Shui 4afc853d4f
Advertise ourselves as compton to X
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-05-21 20:15:28 +01:00
Yuxuan Shui abeeb36bb2
x: wrap xcb_generate_id to check for errors
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-05-21 20:15:28 +01:00
Yuxuan Shui 8cfa750a6d
config: fix grammar 2019-05-21 20:15:28 +01:00
Yuxuan Shui c54b2c0277
win: add new type window_stack_entry 2019-05-21 20:15:28 +01:00
Yuxuan Shui 5077d56676
Refactor linked-list operations into a header
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-05-21 20:15:28 +01:00
Yuxuan Shui b9f894c4fc
win: handle restack to bottom correctly
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-05-21 20:15:27 +01:00
Yuxuan Shui 166ec55778
win: keep a `prev` pointer
Save us some iteration when updating the window stack

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-05-21 20:15:27 +01:00
Yuxuan Shui a68903b9ef
win: track windows with a hash table
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-05-21 20:15:27 +01:00
Yuxuan Shui 3935e97e69
gl_common: bump GL to 3.30
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-05-21 20:15:27 +01:00
Yuxuan Shui 6e8a86d415
gl_common: use vao
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-05-21 20:15:27 +01:00
Yuxuan Shui ffc9c32b5e
gl_common: update gl_compose to core profile
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-05-21 20:15:27 +01:00
Yuxuan Shui f08004a448
gl_common: update gl_blur to core profile
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-05-21 20:15:27 +01:00
Yuxuan Shui 599e8b6600
gl_common: update gl_fill to core profile
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-05-21 20:15:27 +01:00
Yuxuan Shui 233edbd1c3
gl_common: fix implicit conversion warnings
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-05-21 20:15:26 +01:00
Yuxuan Shui 7c2edd9d63
gl_common: remove some fixed function glEnable/Disable
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-05-21 20:15:26 +01:00
Yuxuan Shui d64aab7d40
gl_common: add vertex shader
Also use an attribute for the texture coordinates.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-05-21 20:15:26 +01:00
Yuxuan Shui 18f6a20bf4
new backend: fix crash when window's shadow state change
Create a shadow image for a mapped window when it's shadow become enabled.
For unmapped window, the shadow image is created during mapping. Also,
if the window has IMAGE_ERROR flag, it won't be render anyway. So shadow
image won't be created in that case either.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-05-21 20:15:26 +01:00
Yuxuan Shui eeb8712982
Add debug prints to win_determine_shadow
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-05-21 20:15:26 +01:00
Yuxuan Shui 2040190fb6
utils: improve CHECK() macro
Include the original expression in the assertion failure message.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-05-21 20:15:26 +01:00
Yuxuan Shui 0733f7540f
Silence unused variable warning in release build
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-05-21 20:15:26 +01:00
Yuxuan Shui 63dd16ebac
Use int in margin_t
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-05-21 20:15:25 +01:00
Yuxuan Shui 9677750e3d
Improve checked cast macros
to_{int,char,i16}_checked now works with unsigned types (except
uint64_t).

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-05-21 20:15:25 +01:00
Yuxuan Shui 0037b7e5fb
Eliminate implicit conversions
Use explicit conversions everywhere. Adding bounds check assertions when
necessary.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-05-21 20:15:25 +01:00
Yuxuan Shui 532a90d573
Use __builtin_isnan
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-05-21 20:15:25 +01:00
Yuxuan Shui 15c7abcf41
Make ubsan stricter
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-05-21 20:15:25 +01:00
Yuxuan Shui df2a33e8a8
core: fix a case where closed window is left on screen
If a window is unmapped, then mapped to a different position on screen
before fade out is completed (when fading is not enabled, it has to be
mapped again in the same frame), the old window content is left on screen.

This is because when this happens, we didn't add the unmapping window to
damage.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-05-21 20:15:25 +01:00
Yuxuan Shui 357b7df6ab
ci: fix config after circleci config change
Looks like an empty argument is now the same as no argument. And
circleci complains about argument missing.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-05-21 20:15:25 +01:00
Yuxuan Shui 00b3685bb4
README: fix a word
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-05-21 20:15:25 +01:00
Namkhai Bourquin aa77c6d570
Added FreeBSD build instructions 2019-05-21 20:15:24 +01:00
Yuxuan Shui 49e85f6161
core: opacity_old should be double
Using opacity_t for opacity_old resulting in opacity being rounded to 0.
This is fine until the opacity reaches 0, where the opacity != opacity_old
check fails and the damage is not added.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-05-21 20:15:24 +01:00
Yuxuan Shui a93754009c
Dump damage region info in trace log
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-05-21 20:15:24 +01:00
Yuxuan Shui 1f80e547bc
core: remove unnecessary win_check_fade_finished
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-05-21 20:15:24 +01:00
Yuxuan Shui 6344ae2a46
Format region.h
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-05-21 20:15:24 +01:00
Yuxuan Shui 8155e5e453
core: fix missing damage when window closed
If window is closed when fading is not enabled, the window might be destroyed
before we can add the window extent to damage.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-05-21 20:15:24 +01:00
Yuxuan Shui ad3ec8cada
gl_common: initialize string marker logger
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-05-21 20:15:24 +01:00
Yuxuan Shui 51ad94f745
win: remove unnecessary assertion
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-05-21 20:15:24 +01:00
Greg Flynn 75ef090fc4
fix tiny typo in manpage for --use-damage 2019-05-21 20:15:23 +01:00
Yuxuan Shui d3a2c94461
win: invalidate reg_ignore properly when destroying window
reg_ignore_valid marks the validity of the reg_ignore of the windows
BENEATH the current window. That is, set `w->reg_ignore_valid = false`
doesn't invalidate `w->reg_ignore`.

When destroying window `w`, we need to invalidate all reg_ignore beneath
`w`. So it is not enough to just set `w->next->reg_ignore_valid =
false`, we also need to invalidate `w->next->reg_ignore`.

Yes, this variable name is confusing. Will be changed in the future.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-05-21 20:15:23 +01:00
Yuxuan Shui df15526722
options: print warning for --vsync-aggressive
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-05-21 20:15:23 +01:00
Yuxuan Shui b5b9419ecc
core: don't rebind root image when unredirected
When the screen is not redirected, don't update the root image because
the backend is not initialized in this case.

Fixes a crash.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-05-21 20:15:23 +01:00
Yuxuan Shui f501d35ba9
core: re-run paint_preprocess after redirecting
paint_preprocess calls redir_start if it decides to redirect the screen.
redir_start might change the state of the windows. For example, when the
image of the window fails to bind, redir_start sets the error flag. And
those state changes might exclude the window from being rendered. Thus,
paint_preprocess should be re-run to make sure the new states are
honoured.

Fixes a crash when window images fail to bind after redirecting.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-05-21 20:15:23 +01:00
Yuxuan Shui a3f41bdc25
ci: test config file parsing
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-05-21 20:15:23 +01:00
Yuxuan Shui b5be5e3cdd
ci: fix code coverage reports generation
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-05-21 20:15:23 +01:00
Yuxuan Shui 1ba402e11f
ci: update
The docker image is on debian buster now, adapt.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-05-21 20:15:22 +01:00
Yuxuan Shui edbf7f430c
Initialize tls log structure in main
Fix error reporting when failed to open X display.

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