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>
This commit is contained in:
3
tests/configs/issue357.conf
Normal file
3
tests/configs/issue357.conf
Normal file
@@ -0,0 +1,3 @@
|
||||
fading = true;
|
||||
fade-in-step = 1;
|
||||
fade-out-step = 0.01;
|
||||
@@ -4,6 +4,7 @@ exe=$(realpath $1)
|
||||
cd $(dirname $0)
|
||||
|
||||
./run_one_test.sh $exe configs/empty.conf testcases/basic.py
|
||||
./run_one_test.sh $exe configs/issue357.conf testcases/issue357.py
|
||||
./run_one_test.sh $exe configs/issue239.conf testcases/issue239.py
|
||||
./run_one_test.sh $exe configs/issue239_2.conf testcases/issue239_2.py
|
||||
./run_one_test.sh $exe configs/issue239_3.conf testcases/issue239_3.py
|
||||
|
||||
34
tests/testcases/issue357.py
Executable file
34
tests/testcases/issue357.py
Executable file
@@ -0,0 +1,34 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import xcffib.xproto as xproto
|
||||
import xcffib
|
||||
import time
|
||||
from common import set_window_name, trigger_root_configure
|
||||
|
||||
conn = xcffib.connect()
|
||||
setup = conn.get_setup()
|
||||
root = setup.roots[0].root
|
||||
visual = setup.roots[0].root_visual
|
||||
depth = setup.roots[0].root_depth
|
||||
|
||||
# issue 239 is caused by a window gaining a shadow during its fade-out transition
|
||||
wid = conn.generate_id()
|
||||
print("Window 1: ", hex(wid))
|
||||
|
||||
# Create a window
|
||||
conn.core.CreateWindowChecked(depth, wid, root, 0, 0, 100, 100, 0, xproto.WindowClass.InputOutput, visual, 0, []).check()
|
||||
|
||||
# Set Window name so it doesn't get a shadow
|
||||
set_window_name(conn, wid, "Test window 1")
|
||||
|
||||
# Map the window, causing picom to unredirect
|
||||
print("mapping 1")
|
||||
conn.core.MapWindowChecked(wid).check()
|
||||
time.sleep(0.5)
|
||||
|
||||
trigger_root_configure(conn)
|
||||
|
||||
# Destroy the windows
|
||||
conn.core.DestroyWindowChecked(wid).check()
|
||||
|
||||
time.sleep(1)
|
||||
Reference in New Issue
Block a user