forked from wmutils/core
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwtf.c
More file actions
43 lines (31 loc) · 658 Bytes
/
wtf.c
File metadata and controls
43 lines (31 loc) · 658 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/* See LICENSE file for copyright and license details. */
#include <xcb/xcb.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <err.h>
#include "util.h"
static xcb_connection_t *conn;
static void usage (char *);
static void
usage(char *name)
{
fprintf(stderr, "usage: %s <wid>\n", name);
exit(1);
}
int
main(int argc, char **argv)
{
xcb_window_t win;
if (argc != 2 || strncmp(argv[0], "-h", 2) == 0)
usage(argv[0]);
init_xcb(&conn);
win = strtoul(argv[1], NULL, 16);
if (win) {
xcb_set_input_focus(conn, XCB_INPUT_FOCUS_POINTER_ROOT, win,
XCB_CURRENT_TIME);
xcb_flush(conn);
}
kill_xcb(&conn);
return 0;
}