wmutils

X windows manipulation utilities
git clone git://z3bra.org/wmutils
Log | Files | Refs | LICENSE

commit 64efb1cbecfb2694027d556f5bf1e9167f399def
parent 474b18958441e83442d6c0f0e6f8310401b4a508
Author: dcat <dcat@iotek.org>
Date:   Sun Nov 22 02:52:08 2015

pfw to libwm

Diffstat:
 pfw.c | 21 +--------------------
 1 file changed, 1 insertion(+), 20 deletions(-)

diff --git a/pfw.c b/pfw.c @@ -9,31 +9,12 @@ xcb_connection_t *conn; xcb_screen_t *scrn; -static xcb_window_t focus_window(void); - -static xcb_window_t -focus_window(void) -{ - xcb_window_t w = 0; - xcb_get_input_focus_cookie_t c; - xcb_get_input_focus_reply_t *r; - - c = xcb_get_input_focus(conn); - r = xcb_get_input_focus_reply(conn, c, NULL); - if (r == NULL) - errx(1, "xcb_get_input_focus"); - - w = r->focus; - free(r); - return w; -} - int main(int argc, char **argv) { wm_init_xcb(&conn); - printf("0x%08x\n", focus_window()); + printf("0x%08x\n", wm_get_focus()); wm_kill_xcb(&conn); return 0;