bevyengine / bevyengine/bevy

Moving a bevy window out of a window stack in COSMIC DE makes the window disappear for an annoying amount of time

Open
#25,491 8 comments 0 reactions 0 assignees View on GitHub
A-Windowing C-Bug C-Machine-Specific S-Blocked
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 16h
Merged PRs (30d)
171

Description

I am on NixOS unstable with COSMIC DE Wayland with a AMD Radeon RX 6800.

When i move non-bevy window out of a window stack using keyboard shortcuts everything works as expected (expect for the animation being a bit weird, but that's unrelated to the issue).

When i move a bevy window out of a window stack the entire window disappears for about a second (measured by eye, my sense of time is not good) and,
the log is spammed with messages like `delta time larger than maximum delta, clamping delta to 250ms and skipping 297.957161ms`, varying by seemingly random amounts per message.

Sometimes the rest of the windows auto-resize to fill the screen, sometimes there's a gap where the bevy window should be while it's gone.

Moving/resizing a bevy window without moving it out of a window stack, or moving it into a window stack causes no issue.

The issue does not appear when the bevy window is immediately moved out of the window stack after entering it.

I originally only tested moving the window right, up down, and left have the same issue.

If i start moving the window from a position not at the edge of a window stack (and perform the movement without releasing win) the gap where the bevy window should be is split in 2, with 1 half on the left side of the stack and the other on the right and the gap is dimmed, i have no idea why,

Moving the window into a window stack and back out in one movement without releasing win also causes the issue, but slightly less severe.

## Bevy version and features

- The release number or commit hash of the version you're using: `0.19.1`
- If you're not using default features, the combination of bevy's cargo features you are using: I used `trace_tracy` for the trace, but it has no affect on the issue.

If your bug is rendering-related, copy the adapter info that appears when you run Bevy.

```ignore
AdapterInfo { name: "AMD Radeon RX 6800 (RADV NAVI21)", vendor: 4098, device: 29631, device_type: DiscreteGpu, device_pci_bus_id: "0000:03:00.0", driver: "radv", driver_info: "Mesa 26.1.4", backend: Vulkan, subgroup_min_size: 32, subgroup_max_size: 64, transient_saves_memory: false }
```

## What you did

I ran this code with `cargo run --release`:

```rust
use bevy::prelude::*;

fn main() -> AppExit {
App::new()
.add_plugins(DefaultPlugins)
.add_systems(Startup, startup)
.run()
}

fn startup(mut commands: Commands) {
// the bevy window is weird if the camera is missing
commands.spawn(Camera2d);
}
```

## What went wrong

when i move a bevy window out of a window stack it disappears for about a second.

## Additional information

Other information that can be used to further reproduce or isolate the problem.
This commonly includes:

(**NOTE**: the log, video, and trace are from different runs, all experienced the same issue)
- trace:
For some reason the trace shows the application running at >100FPS with no issues i can see, which is confusing.
I could not upload the file to github as its ~85MB, the link will expire in 7 days,
if anyone needs it after it expires ping me and i will try to upload it again if i still have it:
- logs: https://gist.github.com/miroo-i-dont-want-to-use-gh/8fb62766c2d5444d4e7ae5c319ffafbe
- video of the issue:
In the video i first try to move bevy out of a stack many times, which causes the issue, then i move it in and out rapidly, which works as expected, then i do the same with alacritty, which works as expected.
(fun fact: github doesn't allow mkv files and handbrake is broken on NixOS nightly, uploading this video was a pain)

https://github.com/user-attachments/assets/1e4e19ce-8278-4c01-9c5b-9bbbcc4b1e99

- theories and observations about what might be going wrong:
I honestly have no idea, the trace looks fine, the log correctly sees the delay,
other applications are unaffected.

This being upstream in winit is unlikely as i would have noticed in a lot more rust applications as most rust applications use winit.

The bug is weirdly consistent and inconsistent, i can't get it to not happen, but the delay and whether or not a gap appears where the bevy window should be don't seem to depend on any factors other than randomness.

The bug not appearing when bevy is quickly moved in and out of a window stack makes even less sense.

I uninstalled my printer drivers and CUPS, so those can't be to blame.

a bug in COSMIC would also not make much sense as only bevy is affected.

i originally only tested moving it to the right, up, down, and left have the same issue.
- workarounds that you used: none
- links to related bugs, PRs or discussions: i could not find any

Contributor guide

Open the contributing guide

Research direction

Start with the minimal Rust reproduction in the issue body, run it with `cargo run --release` on NixOS unstable with COSMIC Wayland, and reproduce moving the window out of a stack. Compare the behavior and logs with the reported `delta time larger than maximum delta` messages; done means the Bevy window no longer disappears or leaves a gap during the move.

Written by the indexing model from the issue text.

Assessment

Tech stack
nixos, rust
Domain
desktop, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.