Example #1
0
]

# issue 314 is caused by changing a windows target opacity during its fade-in/-out transition
wid1 = conn.generate_id()
print("Window 1: ", hex(wid1))

atom = "_NET_WM_WINDOW_OPACITY"
opacity_atom = conn.core.InternAtom(False, len(atom), atom).reply().atom

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

# Set Window names
set_window_name(conn, wid1, "Test window 1")

# Check updating opacity while FADING windows
print("Mapping window")
conn.core.MapWindowChecked(wid1).check()
time.sleep(1.2)

print("Update opacity while fading out")
conn.core.ChangePropertyChecked(xproto.PropMode.Replace, wid1, opacity_atom,
                                xproto.Atom.CARDINAL, 32, 1,
                                opacity_single).check()
time.sleep(0.2)
conn.core.ChangePropertyChecked(xproto.PropMode.Replace, wid1, opacity_atom,
                                xproto.Atom.CARDINAL, 32, 1,
                                opacity_0).check()
time.sleep(1)
conn = xcffib.connect()
setup = conn.get_setup()
root = setup.roots[0].root
visual = setup.roots[0].root_visual
depth = setup.roots[0].root_depth

# issue 239 is caused by a window gaining a shadow during its fade-out transition
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()

# Set Window name so it gets a shadow
set_window_name(conn, wid, "YesShadow")

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

time.sleep(0.5)

print("set new name")
set_window_name(conn, wid, "NoShadow")

# Set the Window name so it gets a shadow
print("set new name")
set_window_name(conn, wid, "YesShadow")

time.sleep(0.5)
Example #3
0
conn = xcffib.connect()
setup = conn.get_setup()
root = setup.roots[0].root
visual = setup.roots[0].root_visual
depth = setup.roots[0].root_depth

# issue 394 is caused by a window getting a size update just before destroying leading to a shadow update on destroyed window.
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()

# Set Window name so it doesn't get a shadow
set_window_name(conn, wid, "Test Window")

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

time.sleep(0.5)

# Resize the window and destroy
print("resize and destroy")
set_window_size_async(conn, wid, 150, 150)
conn.core.DestroyWindowChecked(wid).check()

time.sleep(0.5)