glazier

the original window manipulator
Log | Files | Refs | Submodules | README | LICENSE

commit 5e6bf0b2d01e5ab40114b3de30512122898d2dd0
parent 58696186554c09e2c39f038f05b1be7148aa67e8
Author: Willy Goiffon <dev@z3bra.org>
Date:   Tue, 22 Oct 2019 14:01:04 +0200

Respond to config requests from clients

Diffstat:
glazier.c | 20++++++++++++++++++++
1 file changed, 20 insertions(+), 0 deletions(-)

diff --git a/glazier.c b/glazier.c @@ -30,6 +30,7 @@ static int cb_mouse_release(xcb_generic_event_t *); static int cb_motion(xcb_generic_event_t *); static int cb_enter(xcb_generic_event_t *); static int cb_configure(xcb_generic_event_t *); +static int cb_configreq(xcb_generic_event_t *); int verbose = 1; xcb_connection_t *conn; @@ -78,6 +79,7 @@ static const struct ev_callback_t cb[] = { { XCB_MOTION_NOTIFY, cb_motion }, { XCB_ENTER_NOTIFY, cb_enter }, { XCB_CONFIGURE_NOTIFY, cb_configure }, + { XCB_CONFIGURE_REQUEST, cb_configreq }, }; xcb_window_t @@ -404,6 +406,24 @@ cb_configure(xcb_generic_event_t *ev) } static int +cb_configreq(xcb_generic_event_t *ev) +{ + xcb_configure_request_event_t *e; + + e = (xcb_configure_request_event_t *)ev; + + if (verbose) + fprintf(stderr, "config request: 0x%08x (0x%08x:%dx%d+%d+%d)\n", + e->parent, e->window, + e->width, e->height, + e->x, e->y); + + wm_teleport(e->window, e->x, e->y, e->width, e->height); + + return 0; +} + +static int ev_callback(xcb_generic_event_t *ev) { uint8_t i;