From: Kristian Høgsberg Date: Thu, 17 May 2012 02:20:46 +0000 (-0400) Subject: xwm: Resize frame window if child window changes size X-Git-Tag: 20120702.1049~171 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=97460500a808e102e436b4df1fd1ea9c5dbd6943;p=profile%2Fivi%2Fweston.git xwm: Resize frame window if child window changes size --- 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