- // set the frame rect
- frame.rect.setSize(client.rect.width() + frame.margin.left +
- frame.margin.right,
- client.rect.height() + frame.margin.top +
- frame.margin.bottom);
- frame.inside_w = frame.rect.width() - (frame.border_w * 2);
- frame.inside_h = frame.rect.height() - (frame.border_w * 2);
+ /*
+ We first get the normal dimensions and use this to define the inside_w/h
+ then we modify the height if shading is in effect.
+ If the shade state is not considered then frame.rect gets reset to the
+ normal window size on a reconfigure() call resulting in improper
+ dimensions appearing in move/resize and other events.
+ */
+ unsigned int
+ height = client.rect.height() + frame.margin.top + frame.margin.bottom,
+ width = client.rect.width() + frame.margin.left + frame.margin.right;
+
+ frame.inside_w = width - (frame.border_w * 2);
+ frame.inside_h = height - (frame.border_w * 2);
+
+ if (flags.shaded)
+ height = frame.title_h + (frame.border_w * 2);
+ frame.rect.setSize(width, height);