File: pull1091.py

package info (click to toggle)
picom 12.5-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,492 kB
  • sloc: ansic: 28,038; python: 548; sh: 365; makefile: 11
file content (41 lines) | stat: -rwxr-xr-x 1,094 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/usr/bin/env python3

import xcffib.xproto as xproto
import xcffib
from common import *

conn = xcffib.connect()
setup = conn.get_setup()
root = setup.roots[0].root
visual = setup.roots[0].root_visual
depth = setup.roots[0].root_depth

# assertion failure mentioned in 1091 happens when a root change happens right after we
# redirected the screen, before we have even rendered a single frame
wid = conn.generate_id()
print("Window id is ", hex(wid))

# Create a window
conn.core.CreateWindowChecked(depth, wid, root, 0, 0, 100, 100, 0, xproto.WindowClass.InputOutput, visual, 0, []).check()

# Map the window
print("mapping")
conn.core.MapWindowChecked(wid).check()

time.sleep(0.5)

for i in range(0, 8):
	modes = []
	for s in range(0, 10):
		reply, mode, output = prepare_root_configure(conn, i * 100 + 100 + s)
		modes.append((reply, mode, output))

	set_window_bypass_compositor(conn, wid).check()
	time.sleep(0.1)

	set_window_bypass_compositor(conn, wid, 0)
	conn.flush()
	for reply, mode, output in modes:
		trigger_root_configure(conn, reply, mode, output).reply()

	time.sleep(0.1)