Commit Graph

1385 Commits

Author SHA1 Message Date
Yuxuan Shui 1614ae60a7
tests: common: don't fail when atom doesn't exist yet
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-04-10 16:57:19 +01:00
Yuxuan Shui 25832fcc36
tests: common: add find_32bit_visual
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-04-10 16:57:18 +01:00
Yuxuan Shui fd5c95d92a
tests: common: add set_window_class
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-04-10 16:57:17 +01:00
Yuxuan Shui 0116912095
tests: common: set both WM_NAME and _NET_WM_NAME
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-04-10 16:57:06 +01:00
Yuxuan Shui 900b6893d6 github action: update git-clang-format-lint
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-04-10 04:09:07 +01:00
Yuxuan Shui b37db3e051
github actions: update coding style checks
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-04-09 18:09:19 +01:00
Yuxuan Shui be0d4b9681 github action: check coding style of commits
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-04-09 01:14:34 +01:00
yshui 3ad4ce9f77
Merge pull request #364 from tryone144/fix/blur-background-fixed
Experimental backends: fade/hide blur-texture for transparent windows
2020-04-08 23:31:17 +01:00
Bernd Busse c1d985eb7c
tests: update testcase for #314
Handle more (hopefully all) edge-cases when updating `opacity_target_old`:
* `MAPPING` transitions to `FADING` if new target is reached. Otherwise
no update.
* `FADING` clamps to current `opacity` if old target is too small.
* `UNMAPPING`/`DESTROYING` clamps to current `opacity` if old target is
too small.
2020-04-08 23:22:11 +01:00
Bernd Busse cd4913876f
gitignore: exclude python cache for testcases 2020-04-08 23:22:11 +01:00
Bernd Busse 132332c483
win: remove unused parameter `ignore_state`
remove unrequired parameter `ignore_state` of
`win_calc_opacity_target()` that was always `false` now.
2020-04-08 23:22:11 +01:00
Bernd Busse ad8632b017
New backends: smoothly fade blur-texture on fade-in/-out
* Add new field `opacity_target_old` to `struct managed_win` for
tracking relevant `opacity_target` changes.
* Smoothly fade blur-texture opacity on window opacity changes (based on
window opacity), when the window was or will be fully transparent
(`w->opacity ~< 0.004`).
* Fixed alpha-clipping of the blur-texture when using `inactive-opacity` or
repeatedly setting window opacity with large fade intervals (should fix #314).
2020-04-08 23:22:06 +01:00
Yuxuan Shui 32754b0262
win: merge win::pending_updates and win::flags
These two flags are intended for subtly different things. I can probably
justify the distinction, but it's definitely difficult to explain. And
there is no obvious benefits to keep them separate.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-04-06 20:52:32 +01:00
Yuxuan Shui df0be9e990
Move find_client_win to win.c
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-04-06 20:24:16 +01:00
Yuxuan Shui 04fe4a76b2
Revert previous fix for #299
Commits reverted:
b652e8b58d
bdf809d039
e9ab970989
481ac54f67

While those commits themselves could be useful even if they don't
completely fix #299, they come with the risks of introduce more
unforeseen bugs, which outweigh their benefit, so revert them.

A brief explanation of their problem:

The fix hinges on the destroy event of the client window to work.
However, the client window could be destroyed so fast, before we even
handle the map, or even the create, event of the frame. And we won't be
listening for substructure events on the frame at the point the client
window is destroyed. Thus completely miss the client window destroy
event.

Because of the inherent racy nature of Xorg, this approach is really
difficult to make work.

Fixes #371

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-04-06 20:22:54 +01:00
Yuxuan Shui bdf809d039
core: listen for substructure notify on frame windows
So we can pick up destroy notify of the client windows. Because we need
the destroy notify of the client window to trigger a client window
recheck on the frame window. This is to handle the case where a frame
window is later reused, and the case where multiple client windows are
momentarily attached to the same frame[1].

This will also cause events previously unseen to be generated. Most of
the events would be ignored, because they don't have a corresponding
managed window. Change has been made to ev_reparent_notify, so it would
handle the case where a client window is reparented from one frame to
another[2]. Previously such events are not received by picom.

Related[1]: e9ab970989
Related[2]: 481ac54f67
Related: #299

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-04-05 22:45:49 +01:00
Yuxuan Shui e9ab970989
event: destroy: recheck client instead of unmark client
We detach the client window from its frame when it's destroyed, so later
a new window can be attached to that frame. But turns out that's not
enough.

When i3 restarts, it attaches a placeholder window to the frame, then
the real window, and only after that, it will destroy the placeholder.
The real window will fail to attach as the frame already has a client.
When the placeholder is destroyed, we have to call recheck client to
pick up the real window that failed to attach previously.

Related: #299

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-04-05 22:45:35 +01:00
Yuxuan Shui 481ac54f67
event: reparent: handle reparenting from one frame to another
Basically, don't ignore the reparent notify if the window is already a
client window. We already unmark it from its previous frame, so this
commit make sure it gets marked with its new frame.

Related: #299

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-04-05 22:02:51 +01:00
Yuxuan Shui fb24e33d52
x: handle NULL pointer in x_strerror
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-04-05 21:45:51 +01:00
Yuxuan Shui b652e8b58d
event: destroy: unmark client when a client window is destroyed
We do nothing when a non-wm-frame window is destroyed. This will cause
trouble if a wm-frame window is reused (i.e. its child is destroyed then
a new child is reparented to it), because we didn't clear client_win.

So this commit adds a call to win_unmark_client for that case.

Related: #299

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-04-05 21:43:29 +01:00
Yuxuan Shui 68fa49cf59
win: rename find_toplevel_nocache to find_managed_window_or_parent
My previous understanding of this function is incorrect. Hopefully I got
it right this time.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-04-05 21:20:58 +01:00
Yuxuan Shui 71e1a8a06f
event: reparent: always detach window from its previous parent
Otherwise we might see a window becoming child of two different parent
windows.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-04-05 21:12:57 +01:00
Yuxuan Shui 53bb488530
win: rename find_toplevel2 to find_toplevel_nocache
So it is slightly clearer what is the difference to find_toplevel().

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-04-05 20:46:20 +01:00
Yuxuan Shui 397710ac27
tests: add testcase for #314
This should be fixed by merging #364.

Thanks @tryone144 for pointing out the root cause.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-04-05 02:52:12 +01:00
Yuxuan Shui 8e440af222
win: print more debug messages on opacity change
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-04-05 02:50:14 +01:00
Yuxuan Shui 969cbeaf17
config_libconfig: add force-win-blend option
It use to be a command line only option.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-04-05 02:32:54 +01:00
Yuxuan Shui 05e8d0f305
testcases: update comments in issue357.py
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-04-04 17:50:06 +01:00
Yuxuan Shui a23bac727c
new backend: assert blur_opacity is in [0, 1]
Related to: #314 #318

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-04-04 15:55:30 +01:00
Yuxuan Shui 0e158c508f
new backend: clear background if there is no wallpaper
So windows won't left a trail when you move them, because they are drawn
over previously drawn stuff.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-04-02 17:37:52 +01:00
yshui 85086bc984
Merge pull request #362 from Paradigm0001/patch-1
Invert script optimizations
2020-04-01 13:51:17 +01:00
Paradigm0001 1639605306
Update inverter.sh
Error verbose for lack of X Display variable now uses stderr function
2020-04-01 04:50:03 +00:00
Paradigm0001 7f52a4a582
Update inverter.sh
Missed a few more comptons in comments
2020-03-31 12:02:28 +00:00
Paradigm0001 32e0d1c095
Update inverter.sh
Missed a textual remnant of compton, whoops
2020-03-31 11:57:05 +00:00
Paradigm0001 e70803385d
Update inverter.sh
Removed unnecessary if statement and unnecessary /dev/null redirect on line 19
Line 26 can use argless printf rather than echo -n
Error verbose prints in red and to STDERR rather than to STDOUT
Textually replaced compton with picom where applicable.
Removed unnecessary semicolons after exit commands

I might've missed/screwed something but lets hope that isnt the case 😎
2020-03-31 11:52:13 +00:00
Yuxuan Shui c2a18f11d3
Fix nogl build
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-03-31 07:11:02 +01:00
Yuxuan Shui 2372127c0f
core: query glx extension in session_init
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-03-31 06:07:09 +01:00
Yuxuan Shui fd4d43aa02
x: fix glx error codes
compton was using wrong set of constants as glx error codes.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-03-31 05:59:44 +01:00
Yuxuan Shui bdf3aabb75
x: use xcb constants in _x_strerror as mush as possible
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-03-31 05:46:28 +01:00
Yuxuan Shui 9332cba8df core: delayed handling of root ConfigureNotify
Previously, root ConfigureNotify is handled immediately, by resetting
the backend, which in turn releases all the window images. This puts all
the windows into a state where they don't have images attached, which
they really should be in when the screen is redirected.

(To expand a little, a window without images should only exist if:
    * It's an unmanaged window.
    * Screen is unredirected.)

Normally, this kind of window could be fine, as the next render phase
will re-acquire images for them. However, if a window in this state is
destroyed with fading enabled, then the render phase won't try to
acquire images for it, causing it to go into the main rendering function
without images attached, and trigger an assertion.

This commit delays the handling of root ConfigureNotify until the render
phase. This way, the images will be immediately re-acquired after they
are released, thus prevent this problem from happening.

Also adds a testcase for this.

Fixes #357

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-03-31 05:20:56 +01:00
Yuxuan Shui 5a22fb0828 core: mark updates pending when a root flag is set
To make sure handle_root_flags will be called.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-03-31 05:20:56 +01:00
Yuxuan Shui b109526e15
tests: reduce some code duplication
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-03-30 11:49:38 +01:00
Yuxuan Shui 323a59b933
tests: add common functions useful for testing
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-03-30 11:16:56 +01:00
Yuxuan Shui 4c22d564b2
dbus: expose use_damage always
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-03-29 19:17:52 +01:00
Yuxuan Shui b6a5bf720d
dbus: unexpose track_wdata and track_leader
These are internal states.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-03-29 19:17:09 +01:00
Yuxuan Shui ee35bd873a
win: always track property changes
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-03-29 19:15:07 +01:00
Yuxuan Shui 3ba7a2aa4d
core: failed to ungrab server should be fatal
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-03-28 00:18:07 +00:00
Yuxuan Shui 23068c300c
Make some of the error logs more informative
Print the X error causing the error as well.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-03-28 00:15:45 +00:00
Yuxuan Shui 58582eb639
x: add function for converting x error to string
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-03-27 23:07:19 +00:00
Yuxuan Shui 574eca3c25
x: move redirection failure abort out of x_print_error
x_print_error aborts the program when it sees a redirect_subwindow
failure. A function called x_print_error really shouldn't cause the
program to terminate.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-03-27 21:03:37 +00:00
Yuxuan Shui b88d98d6b1
Re-acquire root pixmap after root reconfiguration
In configure_root, the root pixmap is freed by destroy_backend, and is
never acquired again.

Usually this doesn't seem to cause any problems, maybe because we
immediately receives a root damage notification. But under rare
circumstances we ended up not showing the wallpaper.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-03-27 20:51:40 +00:00