Commit Graph

1536 Commits

Author SHA1 Message Date
Yuxuan Shui
cb41ea9644 sample config: add corner-radius and rounded-corners-exclude
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-11-30 00:35:43 +00:00
Yuxuan Shui
0e7b972830 man: add note about rounded corners and transparent clipping
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-11-30 00:35:41 +00:00
Yuxuan Shui
69d4199daa Add rounded-corners-exclude configuration option
Allows the user to selectively disable rounded corners.

Authored-by: Samuel Hand <samuel.d.hand@gmail.com>
2020-11-30 00:35:40 +00:00
Yuxuan Shui
430be62b63 Rounded corners for legacy xrender backend
Authored-by: Samuel Hand <samuel.d.hand@gmail.com>
2020-11-30 00:35:34 +00:00
Samuel Hand
e20b187912 options: add corner-radius
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-11-30 00:31:52 +00:00
yshui
fb38bf021e Merge pull request #546 from yshui/window-state-update
win: rework how events for unmapped windows are handled
2020-11-29 00:20:25 +00:00
Yuxuan Shui
0f975616d6 core: ensure stale flags aren't set in destroy_backend
After 60f733d17c, we can be sure stale
flags won't be seen in destroy_backend.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-11-29 00:14:02 +00:00
Yuxuan Shui
60f733d17c core: don't call map_win_start in handle_new_windows
Set WIN_FLAGS_MAPPED instead, it will be handled later. Previously, we
call map_win_start because we need the geometry of the window, which is
updated in map_win_start. Now, we get the geometry in fill_win, so
map_win_start is not needed anymore.

Eliminate a case where destroy_backend could see IMAGES_STALE flags set
on windows.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-11-28 22:49:18 +00:00
Yuxuan Shui
e49ef2ccd8 core: always clear stale flags in destroy_backend
Reference: https://github.com/yshui/picom/pull/546#discussion_r532054960

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-11-28 20:29:36 +00:00
Yuxuan Shui
862d96d609 testcases: add a test case for #525
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-11-28 20:29:35 +00:00
Yuxuan Shui
1b4dacf2c2 win: add assertion ensuring flags of unmapped windows aren't processed
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-11-28 20:29:34 +00:00
Yuxuan Shui
2d54942295 testcase: add redirect_when_unmapped_window_has_shadow
While working on this PR, I introduced a bug where shadow images for
unmapped windows aren't properly recreated after unredirect/redirect.

The shadow image is freed during unredirect, OTOH redirect only set
IMAGE_STALE flags for mapped window, thus the shadow images for unmapped
windows will be missing.

This bug is already fixed in the previous commit. But the testcase is
good to keep nonetheless.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-11-28 20:29:31 +00:00
Yuxuan Shui
a56d66b4f3 win: rework how events for unmapped windows are handled
Make unmapped window events work mostly like a mapped window, except
flags set on unmapped windows aren't processed until the window is
mapped.

Hopefully this unifies some of the code paths and reduce corner cases.

Should fix #525

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-11-28 20:29:25 +00:00
Yuxuan Shui
bf5a9ca154 tests: don't call .check() in set_window_size
So we can bundle this request together with other requests, making
reproducing time critical bugs easier.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-11-28 19:49:15 +00:00
Yuxuan Shui
fb35feb54e tests: make trigger_root_configure into a 2-step process
This is to allow us sending the root configure request together with
other requests. Making it easier to reproduce timing critical bugs.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-11-28 19:43:17 +00:00
Yuxuan Shui
248bffede7 Fix non-opengl build
Oops

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-11-03 19:03:07 +00:00
Yuxuan Shui
c9f75a53d9 core: fix leak of argb_fbconfig
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-11-02 18:43:12 +00:00
Yuxuan Shui
e3582cd996 legacy backend: render: fix leak of fbconfig
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-11-02 18:23:38 +00:00
Yuxuan Shui
685e5a9aac config_libconfig: allow overrides if supported
Related: #530

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-10-29 09:38:05 +00:00
yshui
8b3e70b40b Merge pull request #531 from omar-polo/next
silencing some compiler warnings
2020-10-28 23:27:38 +00:00
Omar Polo
7eddf79ed2 wrap subobject initialization with braces to silence a warning 2020-10-28 20:27:01 +01:00
Omar Polo
eeaba75a62 use the correct format control for uint64_t 2020-10-28 20:07:14 +01:00
Bernd Busse
3d358a06f2 event: Add missing check if window is managed before setting flags 2020-10-25 12:36:09 +01:00
Yuxuan Shui
9c7f852031 ci: freebsd: add missing dependency
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-10-25 07:03:29 +00:00
Yuxuan Shui
6b3a1e4e14 ci: build test for FreeBSD
Make sure picom builds on FreeBSD

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-10-25 05:23:53 +00:00
Yuxuan Shui
27d59dbb30 picom: get max hostname length with sysconf()
For FreeBSD compatibility, which doesn't define HOST_NAME_MAX.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-10-25 03:13:03 +00:00
Yuxuan Shui
02daff8bc8 README: fix typo
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-10-25 02:57:34 +00:00
Yuxuan Shui
ae62269eb7 Merge remote-tracking branch 'fix/clear-shadow-stale-on-unmap' into next 2020-10-23 17:27:40 +01:00
Yuxuan Shui
dfe4a362e2 win: clear more stale flags when destroying a window
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-10-23 17:22:15 +01:00
yshui
1ce8012519 Merge pull request #522 from tryone144/clang-analyzer-errors
Fix/silence memory errors reported by `scan-build`.
2020-10-23 17:06:27 +01:00
Yuxuan Shui
f5370a1ec0 tests: fix comments
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-10-23 17:02:54 +01:00
Yuxuan Shui
be91b443a8 tests: add testcase for 22162cb7e2
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-10-23 16:54:46 +01:00
Yuxuan Shui
22162cb7e2 win: don't add damage when changing shadow setting while unredirected
When the screen is unredirected, no window have a shadow image. So the
assertions in win_set_shadow don't hold. But in that case, we don't want
to add damages anyway. So we put them behind a check of whether the screen
is redirected.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-10-23 16:44:21 +01:00
Bernd Busse
337831e094 Fix memory errors reported by scan-build.
- Fix non-critical memory-leak in `picom.c` and `options.c` where we
don't free all allocated memory before dieing.

- Explicitly allocate new branch in `c2.c` to silence false-positive
memory-leak.
2020-10-23 17:20:59 +02:00
Yuxuan Shui
3576a92da3 x: wid_get_text_prop shouldn't return 0 strings
Downstream code expect wid_get_text_prop to return at least 1 string.
However wid_get_text_prop would return 0 strings when the property is
set to an empty string.

Fixes: dc37370a66

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-10-23 15:16:11 +01:00
Bernd Busse
1a720edbad win: clear SHADOW_STALE in destroy_win_start
Clear both STALE flags (`IMAGES_STALE = PIXMAP_STALE | SHADOW_STALE`)
when destroying windows (see f493447b33).

Clearing `SHADOW_STALE` as well should eliminate the recreation of a shadow
image for a window currently being destroyed which will cause the
rendering to fail because we can't properly update the flags anymore.

Should fix: #394
2020-10-23 15:46:37 +02:00
Bernd Busse
f53fbdccca Add testcase for #394 2020-10-23 15:46:37 +02:00
yshui
6c6b1afeb3 Merge pull request #516 from yshui/no-xlib
x: remove the last bit of Xlib dependency
2020-10-23 14:19:00 +01:00
Yuxuan Shui
dc37370a66 x: remove the last bit of Xlib dependency
Of course, we still use GLX, so we can't completely remove Xlib yet. But
this removes all Xlib uses outside of the backends.

This drops support for COMPOUND_TEXT Xorg strings, so people how wants
multilingual support has to use UTF8, which should be fine since most of
the applications support that.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-10-23 07:58:01 +01:00
yshui
b675e3f19d Merge pull request #521 from yshui/more-delayed-handling
More delayed event handlings
2020-10-23 07:50:54 +01:00
Yuxuan Shui
e53ac7a6f9 event, win: delayed handling of shape notify
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-10-23 04:37:38 +01:00
Yuxuan Shui
f476a78ad1 event: don't eagerly add damage for configure notify
If a window receives multiple configure notifies in between 2 frames, we
add all the in between positions into damage, when we really just need
the starting and the end position.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-10-23 04:27:35 +01:00
Yuxuan Shui
35b4e82085 win: cache the result of fade-exclude rules
So we don't need to call c2_match every frame something is fading. Also
saves us from some out-of-critical-section X server queries.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-10-23 02:08:34 +01:00
Yuxuan Shui
21e9aab6b6 event: set WIN_FLAGS_FACTOR_CHANGED on tracked property change
Previously, when some explicitly checked property (e.g.
_NET_WM_WINDOW_OPACITY) changed, it won't trigger a
win_on_factor_change, and the rules will not be re-evaluated. Because
that property stale flag will be cleared after we explicitly check the
property, so it won't be detected as a tracked property change.

Here, we instead set WIN_FLAGS_FACTOR_CHANGED directly when a tracked
property changed.

Fixes: f3ff7eff8c

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-10-23 01:58:12 +01:00
yshui
598e70dcea Merge pull request #519 from tryone144/picom-trans-help
Add `--help` and `--toggle` options to `picom-trans`
2020-10-23 01:44:49 +01:00
Yuxuan Shui
a099678664 win: delayed handling of configure notify
Part of the configure notify handling which requires querying the X
server, has been moved into the X critical section.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-10-23 01:36:04 +01:00
yshui
f447e51380 Merge pull request #518 from yshui/delayed-property-update
event: delayed handling of window property changes
2020-10-23 01:30:31 +01:00
Yuxuan Shui
f3ff7eff8c event: delayed handling of window property changes
Move handling window property changes into the X critical section.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-10-23 00:15:54 +01:00
Bernd Busse
a854acc2d0 picom-trans: add --toggle action to toggle between set opacity and unset.
Fixes: #472
2020-10-22 23:06:17 +02:00
Bernd Busse
c9ccd8fb71 picom-trans: Add inline --help output and update manpage
Fixes: #513
2020-10-22 22:53:02 +02:00