Debian Codegraph @

tests/testcases/issue239_3.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
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 239 is caused by a window gaining a shadow during its fade-out transition
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 gets a shadow
22 set_window_name(conn, wid, "YesShadow")
23
24 # Map the window
25 print("mapping")
26 conn.core.MapWindowChecked(wid).check()
27
28 time.sleep(0.5)
29
30 print("set new name")
31 set_window_name(conn, wid, "NoShadow")
32
33 time.sleep(0.5)
34
35 # Set the Window name so it gets a shadow
36 print("set new name")
37 set_window_name(conn, wid, "YesShadow")
38
39 time.sleep(0.5)
40
41 # Unmap the window
42 conn.core.UnmapWindowChecked(wid).check()
43
44 time.sleep(0.5)
45
46 # Destroy the window
47 conn.core.DestroyWindowChecked(wid).check()