Added New Backend Dual Kawase Blur + Rounded Corners - merged with Ibhagwan

This commit is contained in:
jon
2020-07-14 18:04:45 +02:00
parent d6bc68146b
commit 0375dad5d1
54 changed files with 4696 additions and 1620 deletions

View File

@@ -1,35 +1,18 @@
import xcffib.xproto as xproto
import xcffib.randr as randr
import xcffib
import time
import random
import string
def to_atom(conn, string):
return conn.core.InternAtom(False, len(string), string).reply().atom
def set_window_name(conn, wid, name):
prop_name = to_atom(conn, "_NET_WM_NAME")
str_type = to_atom(conn, "UTF8_STRING")
conn.core.ChangePropertyChecked(xproto.PropMode.Replace, wid, prop_name, str_type, 8, len(name), name).check()
prop_name = to_atom(conn, "WM_NAME")
str_type = to_atom(conn, "STRING")
conn.core.ChangePropertyChecked(xproto.PropMode.Replace, wid, prop_name, str_type, 8, len(name), name).check()
def set_window_state(conn, wid, state):
prop_name = to_atom(conn, "WM_STATE")
conn.core.ChangePropertyChecked(xproto.PropMode.Replace, wid, prop_name, prop_name, 32, 2, [state, 0]).check()
def set_window_class(conn, wid, name):
if not isinstance(name, bytearray):
name = name.encode()
name = name+b"\0"+name+b"\0"
prop_name = to_atom(conn, "WM_CLASS")
str_type = to_atom(conn, "STRING")
prop_name = "_NET_WM_NAME"
prop_name = conn.core.InternAtom(True, len(prop_name), prop_name).reply().atom
str_type = "STRING"
str_type = conn.core.InternAtom(True, len(str_type), str_type).reply().atom
conn.core.ChangePropertyChecked(xproto.PropMode.Replace, wid, prop_name, str_type, 8, len(name), name).check()
def find_picom_window(conn):
prop_name = to_atom(conn, "WM_NAME")
prop_name = "WM_NAME"
prop_name = conn.core.InternAtom(True, len(prop_name), prop_name).reply().atom
setup = conn.get_setup()
root = setup.roots[0].root
windows = conn.core.QueryTree(root).reply()
@@ -58,19 +41,3 @@ def trigger_root_configure(conn):
rr.AddOutputModeChecked(output, mode).check()
rr.SetCrtcConfig(reply.crtcs[0], reply.timestamp, reply.config_timestamp, 0, 0, mode, randr.Rotation.Rotate_0, 1, [output]).reply()
def find_32bit_visual(conn):
setup = conn.get_setup()
render = conn(xcffib.render.key)
r = render.QueryPictFormats().reply()
pictfmt_ids = set()
for pictform in r.formats:
if (pictform.depth == 32 and
pictform.type == xcffib.render.PictType.Direct and
pictform.direct.alpha_mask != 0):
pictfmt_ids.add(pictform.id)
print(pictfmt_ids)
for screen in r.screens:
for depth in screen.depths:
for pv in depth.visuals:
if pv.format in pictfmt_ids:
return pv.visual