mirror of
https://github.com/yshui/picom.git
synced 2025-04-14 17:53:25 -04:00
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>
This commit is contained in:
parent
248bffede7
commit
fb35feb54e
5 changed files with 12 additions and 7 deletions
|
@ -45,7 +45,7 @@ def find_picom_window(conn):
|
|||
if name.value.buf() == b"picom":
|
||||
return w
|
||||
|
||||
def trigger_root_configure(conn):
|
||||
def prepare_root_configure(conn):
|
||||
setup = conn.get_setup()
|
||||
root = setup.roots[0].root
|
||||
# Xorg sends root ConfigureNotify when we add a new mode to an output
|
||||
|
@ -61,7 +61,11 @@ def trigger_root_configure(conn):
|
|||
# our xvfb is setup to only have 1 output
|
||||
output = reply.outputs[0]
|
||||
rr.AddOutputModeChecked(output, mode).check()
|
||||
rr.SetCrtcConfig(reply.crtcs[0], reply.timestamp, reply.config_timestamp, 0, 0, mode, randr.Rotation.Rotate_0, 1, [output]).reply()
|
||||
return reply, mode, output
|
||||
|
||||
def trigger_root_configure(conn, reply, mode, output):
|
||||
rr = conn(randr.key)
|
||||
return rr.SetCrtcConfig(reply.crtcs[0], reply.timestamp, reply.config_timestamp, 0, 0, mode, randr.Rotation.Rotate_0, 1, [output])
|
||||
|
||||
def find_32bit_visual(conn):
|
||||
setup = conn.get_setup()
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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, trigger_root_configure, prepare_root_configure
|
||||
|
||||
conn = xcffib.connect()
|
||||
setup = conn.get_setup()
|
||||
|
@ -25,7 +25,8 @@ print("mapping 1")
|
|||
conn.core.MapWindowChecked(wid).check()
|
||||
time.sleep(0.5)
|
||||
|
||||
trigger_root_configure(conn)
|
||||
reply, mode, output = prepare_root_configure(conn)
|
||||
trigger_root_configure(conn, reply, mode, output).reply()
|
||||
|
||||
# Destroy the windows
|
||||
conn.core.DestroyWindowChecked(wid).check()
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Add table
Reference in a new issue