diff options
Diffstat (limited to 'managed.c')
-rw-r--r-- | managed.c | 38 |
1 files changed, 25 insertions, 13 deletions
@@ -170,7 +170,8 @@ extern void managed_property_change( struct gwm_window *window, int prop, if( window->u.managed.state == STATE_NORMAL ) queue_window_update( window->u.managed.frame, 0, 0, window->u.managed.frame->u.frame.width, - FRAME_TITLE_HEIGHT, FALSE ); + frame_t( window->u.managed.frame, FALSE ), + FALSE ); } else { window->u.managed.name = NULL; window->u.managed.net_wm_name = 0; @@ -245,15 +246,18 @@ extern void managed_property_change( struct gwm_window *window, int prop, if( window->u.managed.state == STATE_NORMAL ) queue_window_update( window->u.managed.frame, 0, 0, window->u.managed.frame->u.frame.width, - FRAME_TITLE_HEIGHT, FALSE ); + frame_t( window->u.managed.frame, FALSE ), + FALSE ); break; case PROP_WM_NORMAL_HINTS: /* WM_NORMAL_HINTS property (see ICCCM 2.0, section 4.1.2.3). */ window->u.managed.hints &= ~HINT_POSITION; - window->u.managed.min_width = FRAME_TITLE_HEIGHT; - window->u.managed.min_height = FRAME_TITLE_HEIGHT >> 1; + window->u.managed.min_width = frame_t( window->u.managed.frame, + FALSE ); + window->u.managed.min_height = frame_t( window->u.managed.frame, + FALSE ) >> 1; window->u.managed.max_width = 0x7FFF; window->u.managed.max_height = 0x7FFF; window->u.managed.width_inc = 1; @@ -335,13 +339,17 @@ extern void managed_property_change( struct gwm_window *window, int prop, /* Sanity check. */ screen = screens[ window->screen ]; - if( window->u.managed.min_width < FRAME_TITLE_HEIGHT ) - window->u.managed.min_width = FRAME_TITLE_HEIGHT; + if( window->u.managed.min_width < frame_t( window->u.managed.frame, + FALSE ) ) + window->u.managed.min_width = frame_t( window->u.managed.frame, + FALSE ); if( window->u.managed.min_width > screen->width_in_pixels ) window->u.managed.min_width = screen->width_in_pixels; - - if( window->u.managed.min_height < FRAME_TITLE_HEIGHT >> 1 ) - window->u.managed.min_height = FRAME_TITLE_HEIGHT >> 1; + + if( window->u.managed.min_height < frame_t( window->u.managed.frame, + FALSE ) >> 1 ) + window->u.managed.min_height = frame_t( window->u.managed.frame, + FALSE ) >> 1; if( window->u.managed.min_height > screen->height_in_pixels ) window->u.managed.min_height = screen->height_in_pixels; @@ -382,9 +390,11 @@ extern void managed_property_change( struct gwm_window *window, int prop, if( window->u.managed.state == STATE_NORMAL ) { /* Recalculate constraints. */ int width = window->u.managed.frame->u.frame.width - - ( FRAME_BORDER_WIDTH << 1 ); + frame_l( window->u.managed.frame, FALSE ) - + frame_r( window->u.managed.frame, FALSE ); int height = window->u.managed.frame->u.frame.height - - FRAME_TITLE_HEIGHT - FRAME_BORDER_WIDTH; + frame_t( window->u.managed.frame, FALSE ) - + frame_b( window->u.managed.frame, FALSE ); int old_width, old_height; old_width = width; @@ -471,13 +481,15 @@ extern void match_managed_shape( struct gwm_window *window, int shaped ) { rect.x = rect.y = 0; rect.width = window->u.managed.frame->u.frame.width; - rect.height = FRAME_TITLE_HEIGHT; + rect.height = frame_t( window->u.managed.frame, FALSE ); xcb_shape_rectangles( c, XCB_SHAPE_SO_SET, XCB_SHAPE_SK_BOUNDING, 0, window->u.managed.frame->w, 0, 0, 1, &rect ); xcb_shape_combine( c, XCB_SHAPE_SO_UNION, XCB_SHAPE_SK_BOUNDING, XCB_SHAPE_SK_BOUNDING, window->u.managed.frame->w, - FRAME_BORDER_WIDTH, FRAME_TITLE_HEIGHT, window->w ); + frame_l( window->u.managed.frame, FALSE ), + frame_t( window->u.managed.frame, FALSE ), + window->w ); } else xcb_shape_mask( c, XCB_SHAPE_SO_SET, XCB_SHAPE_SK_BOUNDING, window->u.managed.frame->w, 0, 0, XCB_NONE ); |