diff options
author | Kristian Høgsberg <krh@bitplanet.net> | 2012-05-16 22:20:46 -0400 |
---|---|---|
committer | Kristian Høgsberg <krh@bitplanet.net> | 2012-05-16 22:20:46 -0400 |
commit | 97460500a808e102e436b4df1fd1ea9c5dbd6943 (patch) | |
tree | d157df11801b31be688a35e59fe33f0eac2a8236 | |
parent | b84108d72afc0a29ac7c5271a1c139ca9e6d370d (diff) |
xwm: Resize frame window if child window changes size
-rw-r--r-- | src/xserver-launcher.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/xserver-launcher.c b/src/xserver-launcher.c index 070ffb4..7380d9c 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 |