Convert property management to XCB
I removed the error checking in compton.c because it was dead code. XChangeProperty() always returns 1. Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
parent
a192bfb130
commit
8db6473d32
|
@ -3532,12 +3532,9 @@ register_cm(session_t *ps) {
|
|||
|
||||
// Set _NET_WM_PID
|
||||
{
|
||||
long pid = getpid();
|
||||
if (!XChangeProperty(ps->dpy, ps->reg_win,
|
||||
get_atom(ps, "_NET_WM_PID"), XCB_ATOM_CARDINAL, 32, PropModeReplace,
|
||||
(unsigned char *) &pid, 1)) {
|
||||
printf_errf("(): Failed to set _NET_WM_PID.");
|
||||
}
|
||||
uint32_t pid = getpid();
|
||||
xcb_change_property(c, XCB_PROP_MODE_REPLACE, ps->reg_win,
|
||||
get_atom(ps, "_NET_WM_PID"), XCB_ATOM_CARDINAL, 32, 1, &pid);
|
||||
}
|
||||
|
||||
// Set COMPTON_VERSION
|
||||
|
|
10
src/win.c
10
src/win.c
|
@ -27,14 +27,16 @@ clear_cache_win_leaders(session_t *ps) {
|
|||
|
||||
static inline void
|
||||
wid_set_opacity_prop(session_t *ps, Window wid, opacity_t val) {
|
||||
const unsigned long v = val;
|
||||
XChangeProperty(ps->dpy, wid, ps->atom_opacity, XCB_ATOM_CARDINAL, 32,
|
||||
PropModeReplace, (unsigned char *) &v, 1);
|
||||
const uint32_t v = val;
|
||||
xcb_connection_t *c = XGetXCBConnection(ps->dpy);
|
||||
xcb_change_property(c, XCB_PROP_MODE_REPLACE, wid, ps->atom_opacity,
|
||||
XCB_ATOM_CARDINAL, 32, 1, &v);
|
||||
}
|
||||
|
||||
static inline void
|
||||
wid_rm_opacity_prop(session_t *ps, Window wid) {
|
||||
XDeleteProperty(ps->dpy, wid, ps->atom_opacity);
|
||||
xcb_connection_t *c = XGetXCBConnection(ps->dpy);
|
||||
xcb_delete_property(c, wid, ps->atom_opacity);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue