decorations: make has_ssd public

This commit is contained in:
Tobias Bengfort 2024-04-19 13:35:16 +02:00 committed by Johan Malm
parent a0debda142
commit e2590f10fd
3 changed files with 33 additions and 32 deletions

View file

@ -1218,6 +1218,37 @@ view_toggle_maximize(struct view *view, enum view_axis axis)
}
}
bool
view_wants_decorations(struct view *view)
{
/* Window-rules take priority if they exist for this view */
switch (window_rules_get_property(view, "serverDecoration")) {
case LAB_PROP_TRUE:
return true;
case LAB_PROP_FALSE:
return false;
default:
break;
}
/*
* view->ssd_preference may be set by the decoration implementation
* e.g. src/decorations/xdg-deco.c or src/decorations/kde-deco.c.
*/
switch (view->ssd_preference) {
case LAB_SSD_PREF_SERVER:
return true;
case LAB_SSD_PREF_CLIENT:
return false;
default:
/*
* We don't know anything about the client preference
* so fall back to core.decoration settings in rc.xml
*/
return rc.xdg_shell_server_side_deco;
}
}
void
view_toggle_decorations(struct view *view)
{