@ -493,27 +493,40 @@ frame_resize(struct frame *frame, int32_t width, int32_t height)
}
}
void
void
frame_resize_inside ( struct frame * frame , int32_t width , int32_t height )
frame_decoration_sizes ( struct frame * frame , int32_t * top , int32_t * bottom ,
int32_t * left , int32_t * right )
{
{
struct theme * t = frame - > theme ;
struct theme * t = frame - > theme ;
int decoration_width , decoration_height , titlebar_height ;
/* Top may have a titlebar */
if ( frame - > title | | ! wl_list_empty ( & frame - > buttons ) )
if ( frame - > title | | ! wl_list_empty ( & frame - > buttons ) )
titlebar_height = t - > titlebar_height ;
* top = t - > titlebar_height ;
else
else
titlebar_height = t - > width ;
* top = t - > width ;
if ( frame - > flags & FRAME_FLAG_MAXIMIZED ) {
/* All other sides have the basic frame thickness */
decoration_width = t - > width * 2 ;
* bottom = t - > width ;
decoration_height = t - > width + titlebar_height ;
* right = t - > width ;
} else {
* left = t - > width ;
decoration_width = ( t - > width + t - > margin ) * 2 ;
decoration_height = t - > width +
if ( frame - > flags & FRAME_FLAG_MAXIMIZED )
titlebar_height + t - > margin * 2 ;
return ;
/* Not maximized, add shadows */
* top + = t - > margin ;
* bottom + = t - > margin ;
* left + = t - > margin ;
* right + = t - > margin ;
}
}
frame_resize ( frame , width + decoration_width ,
void
height + decoration_height ) ;
frame_resize_inside ( struct frame * frame , int32_t width , int32_t height )
{
int32_t top , bottom , left , right ;
frame_decoration_sizes ( frame , & top , & bottom , & left , & right ) ;
frame_resize ( frame , width + left + right ,
height + top + bottom ) ;
}
}
int32_t
int32_t