mirror of
https://github.com/yshui/picom.git
synced 2024-11-18 13:55:36 -05:00
tests: add a repro for #1091
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
parent
618cf64b23
commit
239a901bbf
5 changed files with 50 additions and 3 deletions
1
tests/configs/pull1091.conf
Normal file
1
tests/configs/pull1091.conf
Normal file
|
@ -0,0 +1 @@
|
|||
unredir-if-possible = true;
|
|
@ -20,3 +20,4 @@ eval `dbus-launch --sh-syntax`
|
|||
./run_one_test.sh $exe configs/clear_shadow_unredirected.conf testcases/redirect_when_unmapped_window_has_shadow.py
|
||||
./run_one_test.sh $exe configs/issue394.conf testcases/issue394.py
|
||||
./run_one_test.sh $exe configs/issue239.conf testcases/issue525.py
|
||||
./run_one_test.sh $exe configs/pull1091.conf testcases/pull1091.py
|
||||
|
|
|
@ -33,6 +33,10 @@ def set_window_size_async(conn, wid, width, height):
|
|||
value_list = [width, height]
|
||||
return conn.core.ConfigureWindowChecked(wid, value_mask, value_list)
|
||||
|
||||
def set_window_bypass_compositor(conn, wid, value = 1):
|
||||
prop_name = to_atom(conn, "_NET_WM_BYPASS_COMPOSITOR")
|
||||
return conn.core.ChangePropertyChecked(xproto.PropMode.Replace, wid, prop_name, xproto.Atom.CARDINAL, 32, 1, [value])
|
||||
|
||||
def find_picom_window(conn):
|
||||
prop_name = to_atom(conn, "WM_NAME")
|
||||
setup = conn.get_setup()
|
||||
|
@ -45,13 +49,13 @@ def find_picom_window(conn):
|
|||
if name.value.buf() == b"picom":
|
||||
return w
|
||||
|
||||
def prepare_root_configure(conn):
|
||||
def prepare_root_configure(conn, size = 1000):
|
||||
setup = conn.get_setup()
|
||||
root = setup.roots[0].root
|
||||
# Xorg sends root ConfigureNotify when we add a new mode to an output
|
||||
rr = conn(randr.key)
|
||||
name = ''.join([random.choice(string.ascii_letters + string.digits) for n in range(0, 32)])
|
||||
mode_info = randr.ModeInfo.synthetic(id = 0, width = 1000, height = 1000, dot_clock = 0,
|
||||
mode_info = randr.ModeInfo.synthetic(id = 0, width = size, height = size, dot_clock = 0,
|
||||
hsync_start = 0, hsync_end = 0, htotal = 0, hskew = 0, vsync_start = 0, vsync_end = 0,
|
||||
vtotal = 0, name_len = len(name), mode_flags = 0)
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
import xcffib.xproto as xproto
|
||||
import xcffib
|
||||
import time
|
||||
from common import set_window_name, trigger_root_configure
|
||||
from common import set_window_name
|
||||
|
||||
conn = xcffib.connect()
|
||||
setup = conn.get_setup()
|
||||
|
|
41
tests/testcases/pull1091.py
Executable file
41
tests/testcases/pull1091.py
Executable file
|
@ -0,0 +1,41 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
import xcffib.xproto as xproto
|
||||
import xcffib
|
||||
from common import *
|
||||
|
||||
conn = xcffib.connect()
|
||||
setup = conn.get_setup()
|
||||
root = setup.roots[0].root
|
||||
visual = setup.roots[0].root_visual
|
||||
depth = setup.roots[0].root_depth
|
||||
|
||||
# assertion failure mentioned in 1091 happens when a root change happens right after we
|
||||
# redirected the screen, before we have even rendered a single frame
|
||||
wid = conn.generate_id()
|
||||
print("Window id is ", hex(wid))
|
||||
|
||||
# Create a window
|
||||
conn.core.CreateWindowChecked(depth, wid, root, 0, 0, 100, 100, 0, xproto.WindowClass.InputOutput, visual, 0, []).check()
|
||||
|
||||
# Map the window
|
||||
print("mapping")
|
||||
conn.core.MapWindowChecked(wid).check()
|
||||
|
||||
time.sleep(0.5)
|
||||
|
||||
for i in range(0, 8):
|
||||
modes = []
|
||||
for s in range(0, 10):
|
||||
reply, mode, output = prepare_root_configure(conn, i * 100 + 100 + s)
|
||||
modes.append((reply, mode, output))
|
||||
|
||||
set_window_bypass_compositor(conn, wid).check()
|
||||
time.sleep(0.1)
|
||||
|
||||
set_window_bypass_compositor(conn, wid, 0)
|
||||
conn.flush()
|
||||
for reply, mode, output in modes:
|
||||
trigger_root_configure(conn, reply, mode, output).reply()
|
||||
|
||||
time.sleep(0.1)
|
Loading…
Reference in a new issue