Beispiel #1
0
def test_kill_via_message(xmanager):
    xmanager.test_window("one")
    window_info = xmanager.c.window.info()
    conn = xcbq.Connection(xmanager.display)
    data = xcffib.xproto.ClientMessageData.synthetic([0, 0, 0, 0, 0], "IIIII")
    ev = xcffib.xproto.ClientMessageEvent.synthetic(
        32, window_info["id"], conn.atoms['_NET_CLOSE_WINDOW'], data)
    conn.default_screen.root.send_event(
        ev, mask=xcffib.xproto.EventMask.SubstructureRedirect)
    conn.xsync()
    conn.finalize()
    assert_window_died(xmanager.c, window_info)
Beispiel #2
0
def test_kill_other(manager):
    manager.c.group.setlayout("tile")
    one = manager.test_window("one")
    assert manager.c.window.info()["width"] == 798
    window_one_info = manager.c.window.info()
    assert manager.c.window.info()["height"] == 578
    two = manager.test_window("two")
    assert manager.c.window.info()["name"] == "two"
    assert manager.c.window.info()["width"] == 398
    assert manager.c.window.info()["height"] == 578
    assert len(manager.c.windows()) == 2

    manager.kill_window(one)
    assert_window_died(manager.c, window_one_info)

    assert manager.c.window.info()["name"] == "two"
    assert manager.c.window.info()["width"] == 798
    assert manager.c.window.info()["height"] == 578
    manager.kill_window(two)
Beispiel #3
0
def test_static(manager):
    manager.test_window("one")
    manager.test_window("two")
    manager.c.window[manager.c.window.info()["id"]].static(
        screen=0,
        x=10,
        y=10,
        width=10,
        height=10,
    )
    info = manager.c.window.info()
    assert info["name"] == "one"
    manager.c.window.kill()
    assert_window_died(manager.c, info)
    with pytest.raises(CommandError):
        manager.c.window.info()
    info = manager.c.windows()[0]
    assert info["name"] == "two"
    assert (info["x"], info["y"], info["width"], info["height"]) == (10, 10, 10, 10)
Beispiel #4
0
def test_kill_window(manager):
    manager.test_window("one")
    window_info = manager.c.window.info()
    manager.c.window[window_info["id"]].kill()
    assert_window_died(manager.c, window_info)