Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Got it building again (xcb api changes, setup.py bitrot)

  • Loading branch information...
commit 7a17041c8f9ffd77dc1b80e9ed7e5cbb3a1ce0a1 1 parent 104a891
@chipaca authored
Showing with 27 additions and 20 deletions.
  1. +15 −15 caw/cawc.c
  2. +12 −5 setup.py
View
30 caw/cawc.c
@@ -165,11 +165,11 @@ _update_struts(PyObject *self, PyObject *args)
}
xcb_change_property(connection, XCB_PROP_MODE_REPLACE,
- window, atoms[_NET_WM_STRUT], CARDINAL,
+ window, atoms[_NET_WM_STRUT], XCB_ATOM_CARDINAL,
32, 4, data);
xcb_change_property(connection, XCB_PROP_MODE_REPLACE,
- window, atoms[_NET_WM_STRUT_PARTIAL], CARDINAL,
+ window, atoms[_NET_WM_STRUT_PARTIAL], XCB_ATOM_CARDINAL,
32, 12, data);
Py_RETURN_NONE;
@@ -182,7 +182,7 @@ _set_hints(PyObject *self, PyObject *args)
xcb_connection_t *connection;
xcb_window_t window;
int x, y, w, h;
- xcb_wm_hints_t hints;
+ xcb_icccm_wm_hints_t hints;
xcb_size_hints_t normal_hints;
//xcb_generic_error_t *e;
@@ -203,27 +203,27 @@ _set_hints(PyObject *self, PyObject *args)
*/
// send requests
- xcb_get_property_cookie_t hint_c = xcb_get_wm_hints(connection, window);
- xcb_get_property_cookie_t normal_hints_c = xcb_get_wm_normal_hints(connection, window);
+ xcb_get_property_cookie_t hint_c = xcb_icccm_get_wm_hints(connection, window);
+ xcb_get_property_cookie_t normal_hints_c = xcb_icccm_get_wm_normal_hints(connection, window);
// set wm hints
- xcb_get_wm_hints_reply(connection, hint_c, &hints, 0);
- xcb_wm_hints_set_input(&hints, 0);
- xcb_wm_hints_set_normal(&hints);
- xcb_set_wm_hints(connection, window, &hints);
+ xcb_icccm_get_wm_hints_reply(connection, hint_c, &hints, 0);
+ xcb_icccm_wm_hints_set_input(&hints, 0);
+ xcb_icccm_wm_hints_set_normal(&hints);
+ xcb_icccm_set_wm_hints(connection, window, &hints);
// set the normal hints
- xcb_get_wm_normal_hints_reply(connection, normal_hints_c, &normal_hints, 0);
+ xcb_icccm_get_wm_normal_hints_reply(connection, normal_hints_c, &normal_hints, 0);
//printf("w: %d, h: %d\n", w, h);
- normal_hints.flags = XCB_SIZE_HINT_P_POSITION;
- xcb_size_hints_set_position(&normal_hints, 0, x, y);
- xcb_size_hints_set_min_size(&normal_hints, w, h);
- xcb_size_hints_set_max_size(&normal_hints, w, h);
+ normal_hints.flags = XCB_ICCCM_SIZE_HINT_P_POSITION;
+ xcb_icccm_size_hints_set_position(&normal_hints, 0, x, y);
+ xcb_icccm_size_hints_set_min_size(&normal_hints, w, h);
+ xcb_icccm_size_hints_set_max_size(&normal_hints, w, h);
- xcb_set_wm_normal_hints(connection, window, &normal_hints);
+ xcb_icccm_set_wm_normal_hints(connection, window, &normal_hints);
/*
data[0] = atoms[_NET_WM_STATE_SKIP_TASKBAR];
View
17 setup.py
@@ -13,16 +13,23 @@
def pkgconfig(*packages, **kw):
flag_map = {'-I': 'include_dirs', '-L': 'library_dirs', '-l': 'libraries'}
- for token in commands.getoutput("pkg-config --libs --cflags %s" % ' '.join(packages)).split():
- kw.setdefault(flag_map.get(token[:2]), []).append(token[2:])
+ packages = ' '.join(packages)
+ for flag, extra in [("--libs", "extra_link_args"),
+ ("--cflags", "extra_compile_args"),
+ ]:
+ for token in commands.getoutput("pkg-config %s %s" % (flag, packages)).split():
+ if token[:2] in flag_map:
+ kw.setdefault(flag_map[token[:2]], []).append(token[2:])
+ else:
+ kw.setdefault(extra, []).append(token)
return kw
# Distutils config
+extargs = pkgconfig('xcb','xcb-atom','xcb-icccm', 'cairo','pango','pangocairo',
+ extra_compile_args=['-Wall'])
module = Extension("caw/cawc",
sources = ["caw/cawc.c"],
- extra_compile_args = ['-Wall'],
- **pkgconfig('xcb','xcb-atom','xcb-icccm','cairo','pango','pangocairo')
- #libraries = ['xcb','xcb-atom','xcb-icccm','cairo','freetype2', 'x11', 'x11-xcb', 'xft'],
+ **extargs
)
py_modules = []
Please sign in to comment.
Something went wrong with that request. Please try again.