Debian Codegraph @

tests/testcases/issue394.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, set_window_size_async
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 394 is caused by a window getting a size update just before destroying leading to a shadow update on destroyed window.
15 wid = conn.generate_id()
16 print("Window id is ", 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 so it doesn't get a shadow
22 set_window_name(conn, wid, "Test Window")
23
24 # Map the window
25 print("mapping")
26 conn.core.MapWindowChecked(wid).check()
27
28 time.sleep(0.5)
29
30 # Resize the window and destroy
31 print("resize and destroy")
32 set_window_size_async(conn, wid, 150, 150)
33 conn.core.DestroyWindowChecked(wid).check()
34
35 time.sleep(0.5)