| 1 |
|
| 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 |
|
| 15 |
wid = conn.generate_id() |
| 16 |
print("Window id is ", hex(wid)) |
| 17 |
|
| 18 |
|
| 19 |
conn.core.CreateWindowChecked(depth, wid, root, 0, 0, 100, 100, 0, xproto.WindowClass.InputOutput, visual, 0, []).check() |
| 20 |
|
| 21 |
|
| 22 |
set_window_name(conn, wid, "Test Window") |
| 23 |
|
| 24 |
|
| 25 |
print("mapping") |
| 26 |
conn.core.MapWindowChecked(wid).check() |
| 27 |
|
| 28 |
time.sleep(0.5) |
| 29 |
|
| 30 |
|
| 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) |