tree-wide: do not try to use outputs with no scene_output

- check for valid scene_output in output_is_usable()
- change many "output != NULL" checks to use output_is_usable()
- remove one now-redundant separate check for valid scene_output

Fixes a crash at startup (with autoEnableOutputs=no) due to
dereferencing null scene_output in create_output_config() since:

7d7ece21d9
("output: suppress error when output position is unavailable")

Fixes: #3357
This commit is contained in:
John Lindgren 2026-02-04 10:31:06 -05:00 committed by Johan Malm
parent 81778a16bb
commit 4f8b80700e
9 changed files with 24 additions and 31 deletions

View file

@ -1105,7 +1105,7 @@ view_place_by_policy(struct view *view, bool allow_cursor,
void
view_constrain_size_to_that_of_usable_area(struct view *view)
{
if (!view || !view->output || view->fullscreen) {
if (!view || !output_is_usable(view->output) || view->fullscreen) {
return;
}
@ -1900,7 +1900,7 @@ view_move_to_edge(struct view *view, enum lab_edge direction, bool snap_to_windo
/* Otherwise, move to edge of next adjacent display, if possible */
struct output *output =
output_get_adjacent(view->output, direction, /* wrap */ false);
if (!output) {
if (!output_is_usable(output)) {
return;
}
@ -2080,7 +2080,7 @@ view_snap_to_edge(struct view *view, enum lab_edge edge,
*/
output = output_get_adjacent(view->output, edge,
/* wrap */ false);
if (!output) {
if (!output_is_usable(output)) {
return;
}
edge = invert_edge;