void ssd_update_title(struct ssd *ssd);
void ssd_update_geometry(struct ssd *ssd);
void ssd_destroy(struct ssd *ssd);
-bool ssd_titlebar_is_hidden(struct ssd *ssd);
void ssd_titlebar_hide(struct ssd *ssd);
void ssd_enable_keybind_inhibit_indicator(struct ssd *ssd, bool enable);
/*
* Check preconditions for displaying SSD. Note that this
* needs to work even before ssd_create() has been called.
+ *
+ * For that reason we are not using the .enabled state of
+ * the titlebar node here but rather check for the view
+ * boolean. If we were to use the .enabled state this would
+ * cause issues on Reconfigure events with views which were
+ * in border-only deco mode as view->ssd would only be set
+ * after ssd_create() returns.
*/
if (!view->ssd_enabled || view->fullscreen) {
return (struct border){ 0 };
if (view->maximized) {
struct border thickness = { 0 };
- if (!ssd_titlebar_is_hidden(view->ssd)) {
+ if (!view->ssd_titlebar_hidden) {
thickness.top += theme->title_height;
}
return thickness;
.right = theme->border_width,
};
- if (ssd_titlebar_is_hidden(view->ssd)) {
+ if (view->ssd_titlebar_hidden) {
thickness.top -= theme->title_height;
}
return thickness;
ssd_extents_create(ssd);
ssd_border_create(ssd);
ssd_titlebar_create(ssd);
- if (rc.ssd_keep_border && view->ssd_titlebar_hidden) {
- /* Ensure we keep the old state when exiting fullscreen */
+ if (view->ssd_titlebar_hidden) {
+ /* Ensure we keep the old state on Reconfigure or when exiting fullscreen */
ssd_titlebar_hide(ssd);
}
ssd->margin = ssd_thickness(view);
ssd->state.geometry = current;
}
-bool
-ssd_titlebar_is_hidden(struct ssd *ssd)
-{
- return ssd && !ssd->titlebar.tree->node.enabled;
-}
-
void
ssd_titlebar_hide(struct ssd *ssd)
{
{
assert(view);
if (rc.ssd_keep_border && view->ssd_enabled && view->ssd
- && !ssd_titlebar_is_hidden(view->ssd)) {
- ssd_titlebar_hide(view->ssd);
+ && !view->ssd_titlebar_hidden) {
+ /*
+ * ssd_titlebar_hidden has to be set before calling
+ * ssd_titlebar_hide() to make ssd_thickness() happy.
+ */
view->ssd_titlebar_hidden = true;
+ ssd_titlebar_hide(view->ssd);
if (!view_is_floating(view)) {
view_apply_special_geometry(view);
}