| 1 |
|
| 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 |
name = "_NET_WM_STATE" |
| 15 |
name_atom = conn.core.InternAtom(False, len(name), name).reply().atom |
| 16 |
atom = "ATOM" |
| 17 |
atom_atom = conn.core.InternAtom(False, len(atom), atom).reply().atom |
| 18 |
fs = "_NET_WM_STATE_FULLSCREEN" |
| 19 |
fs_atom = conn.core.InternAtom(False, len(fs), fs).reply().atom |
| 20 |
|
| 21 |
|
| 22 |
wid = conn.generate_id() |
| 23 |
print("Window id is ", hex(wid)) |
| 24 |
|
| 25 |
|
| 26 |
conn.core.CreateWindowChecked(depth, wid, root, 0, 0, 100, 100, 0, xproto.WindowClass.InputOutput, visual, 0, []).check() |
| 27 |
|
| 28 |
|
| 29 |
set_window_name(conn, wid, "YesShadow") |
| 30 |
|
| 31 |
|
| 32 |
print("mapping") |
| 33 |
conn.core.MapWindowChecked(wid).check() |
| 34 |
|
| 35 |
time.sleep(0.5) |
| 36 |
|
| 37 |
|
| 38 |
conn.core.ChangePropertyChecked(xproto.PropMode.Replace, wid, name_atom, atom_atom, 32, 1, [fs_atom]).check() |
| 39 |
|
| 40 |
time.sleep(0.5) |
| 41 |
|
| 42 |
|
| 43 |
print("set new name") |
| 44 |
set_window_name(conn, wid, "NoShadow") |
| 45 |
|
| 46 |
|
| 47 |
conn.core.UnmapWindowChecked(wid).check() |
| 48 |
|
| 49 |
time.sleep(0.5) |
| 50 |
|
| 51 |
|
| 52 |
conn.core.DestroyWindowChecked(wid).check() |