master ohmu/mwmutils / core / fw.c
ohmu  ·  2026-07-15
 1// focused window
 2
 3#include <stdio.h>
 4#include <xcb/xcb.h>
 5#include <stdlib.h>
 6
 7xcb_connection_t *connection;
 8
 9int
10main(int argc, char *argv[]) 
11{
12    xcb_get_input_focus_cookie_t cookie;
13    xcb_get_input_focus_reply_t *reply;
14    connection = xcb_connect(NULL,NULL);
15    cookie = xcb_get_input_focus(connection);
16    reply = xcb_get_input_focus_reply(connection, cookie, NULL);
17    printf("0x%08x\n", reply->focus);
18    free(reply);
19    xcb_disconnect(connection);
20    return 0;
21}