Defer fullscreen placement until an output is available

8f3a9fa3dabb348cf163b9a85bdf2eb0d4e7f22c
Alexis Sellier committed ago 1 parent be315416
swm.c +2 -1
4286 4286
     * already configured; place and size the new scene without scheduling a
4287 4287
     * redundant fullscreen-state configure from the map callback. */
4288 4288
    if (c->is_fullscreen) {
4289 4289
        c->prev = c->geom;
4290 4290
        wlr_scene_node_reparent(&c->scene->node, layers[LAYER_FULLSCREEN]);
4291 -
        resize(c, c->mon->m, 0);
4291 +
        if (c->mon)
4292 +
            resize(c, c->mon->m, 0);
4292 4293
    }
4293 4294
    /* Publish the window to taskbars and switchers. */
4294 4295
    c->ftl = wlr_foreign_toplevel_handle_v1_create(ftl_mgr);
4295 4296
4296 4297
    if (c->ftl) {
test/clients.py +12 -0
353 353
        connection.roundtrips(4)
354 354
        if window.fullscreen:
355 355
            raise Failure("pre-map fullscreen window did not leave fullscreen")
356 356
        window.destroy()
357 357
        connection.roundtrips(2)
358 +
    subprocess.run(["wlr-randr", "--output", "HEADLESS-1", "--off"], check=True)
359 +
    window = Window(connection, "fullscreen-without-output", 0xFF224466, fullscreen=True)
360 +
    connection.roundtrips(4)
361 +
    subprocess.run(["wlr-randr", "--output", "HEADLESS-1", "--on"], check=True)
362 +
    connection.roundtrips(4)
363 +
    if not window.fullscreen or window.width <= 320 or window.height <= 200:
364 +
        raise Failure("fullscreen window did not fill the restored output")
365 +
    window.toplevel.unset_fullscreen()
366 +
    connection.roundtrips(4)
367 +
    if window.fullscreen:
368 +
        raise Failure("restored window did not leave fullscreen")
369 +
    window.destroy()
358 370
    connection.close()
359 371
360 372
361 373
def transient(arguments: list[str]) -> None:
362 374
    """Exercise popup, parented, and fullscreen XDG surfaces."""