Debian Codegraph @

tests/testcases/issue525.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 525 happens when a window is unmapped with pixmap stale flag set
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 # Map the window
22 print("mapping")
23 conn.core.MapWindowChecked(wid).check()
24
25 time.sleep(0.5)
26
27 # change window size, invalidate the pixmap
28 conn.core.ConfigureWindow(wid, xproto.ConfigWindow.X | xproto.ConfigWindow.Width, [100, 200])
29
30 # unmap the window immediately after
31 conn.core.UnmapWindowChecked(wid).check()
32
33 time.sleep(0.1)
34
35 # Destroy the window
36 conn.core.DestroyWindowChecked(wid).check()