wmutils

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

commit bdb3b35e838bf051857237a5bd4e0241a0c5bc52
parent c4588e45882b4b5249fd4a7f4f3eb26631f7a8f0
Author: dcat <dcat@iotek.org>
Date:   Thu Dec 18 14:10:20 2014

WTF! we don't need geometry

Diffstat:
 wtf.c | 18 +++---------------
 1 file changed, 3 insertions(+), 15 deletions(-)

diff --git a/wtf.c b/wtf.c @@ -24,7 +24,6 @@ static xcb_connection_t *conn; static void usage (char *name); -static void set_focus (xcb_window_t); static void usage (char *name) @@ -33,19 +32,6 @@ usage (char *name) exit(1); } -static void -set_focus (xcb_window_t win) -{ - xcb_get_geometry_reply_t *geom; - geom = xcb_get_geometry_reply(conn, xcb_get_geometry(conn, win), NULL); - - if (!geom) - errx(1, "center_pointer: missing geometry!"); - - xcb_set_input_focus(conn, XCB_INPUT_FOCUS_POINTER_ROOT, win, - XCB_CURRENT_TIME); -} - int main (int argc, char **argv) { @@ -61,7 +47,9 @@ main (int argc, char **argv) if (!win) errx(1, "could not get focused window"); - set_focus(win); + xcb_set_input_focus(conn, XCB_INPUT_FOCUS_POINTER_ROOT, win, + XCB_CURRENT_TIME); + xcb_flush(conn); kill_xcb(&conn);