Debian Codegraph @

tests/testcases/issue357.py

raw symbols SCIP
1 #!/usr/bin/env python3
2
3 import xcffib.xproto as xproto
4 import xcffib
5 import time
6 from common import set_window_name, trigger_root_configure, prepare_root_configure
7
8 conn = xcffib.connect()
9 setup = conn.get_setup()
10 root = setup.roots[0].root
11 visual = setup.roots[0].root_visual
12 depth = setup.roots[0].root_depth
13
14 # issue 357 is triggered when a window is destroyed right after configure_root
15 wid = conn.generate_id()
16 print("Window 1: ", hex(wid))
17
18 # Create a window
19 conn.core.CreateWindowChecked(depth, wid, root, 0, 0, 100, 100, 0, xproto.WindowClass.InputOutput, visual, 0, []).check()
20
21 # Set Window name
22 set_window_name(conn, wid, "Test window 1")
23
24 print("mapping 1")
25 conn.core.MapWindowChecked(wid).check()
26 time.sleep(0.5)
27
28 reply, mode, output = prepare_root_configure(conn)
29 trigger_root_configure(conn, reply, mode, output).reply()
30
31 # Destroy the windows
32 conn.core.DestroyWindowChecked(wid).check()
33
34 time.sleep(1)