desktop: Avoid centering views without initial geometry

This commit is contained in:
John Lindgren 2023-02-15 12:52:57 -05:00 committed by Johan Malm
parent e465a41c0a
commit 859eba1c6b
2 changed files with 17 additions and 2 deletions

View file

@ -245,6 +245,10 @@ view_output(struct view *view)
static bool
view_compute_centered_position(struct view *view, int w, int h, int *x, int *y)
{
if (w <= 0 || h <= 0) {
wlr_log(WLR_ERROR, "view has empty geometry, not centering");
return false;
}
struct output *output = view_output(view);
if (!output) {
return false;