From 97460500a808e102e436b4df1fd1ea9c5dbd6943 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristian=20H=C3=B8gsberg?= Date: Wed, 16 May 2012 22:20:46 -0400 Subject: [PATCH] xwm: Resize frame window if child window changes size --- src/xserver-launcher.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/xserver-launcher.c b/src/xserver-launcher.c index 070ffb42..7380d9c8 100644 --- a/src/xserver-launcher.c +++ b/src/xserver-launcher.c @@ -630,11 +630,32 @@ weston_wm_handle_configure_notify(struct weston_wm *wm, xcb_generic_event_t *eve { xcb_configure_notify_event_t *configure_notify = (xcb_configure_notify_event_t *) event; + struct weston_wm_window *window; + struct theme *t = wm->theme; + uint32_t values[2]; fprintf(stderr, "XCB_CONFIGURE_NOTIFY (window %d) %d,%d @ %dx%d\n", configure_notify->window, configure_notify->x, configure_notify->y, configure_notify->width, configure_notify->height); + + window = hash_table_lookup(wm->window_hash, configure_notify->window); + + if (configure_notify->window != window->id) + return; + + window->width = configure_notify->width; + window->height = configure_notify->height; + + values[0] = window->width + (t->margin + t->width) * 2; + values[1] = + window->height + t->margin * 2 + t->width + t->titlebar_height; + + xcb_configure_window(wm->conn, + window->frame_id, + XCB_CONFIG_WINDOW_WIDTH | + XCB_CONFIG_WINDOW_HEIGHT, + values); } static void