bevyengine / bevyengine/bevy

PrimaryMonitor component not added to any Monitor entities

Open
#21,777 1 comment 0 reactions 0 assignees View on GitHub
A-Windowing C-Bug D-Straightforward S-Ready-For-Implementation
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 22h
Merged PRs (30d)
161

Description

## Bevy version and features

0.17.2

## \[Optional\] Relevant system information
Linux - Wayland

## What you did
When querying PrimaryMonitor, no entities contain component when run at the PostStartup schedule.
```Rust
pub fn detect_primary_monitor_settings(
mut commands: Commands,
q_primary_monitor: Query<(Entity, &mut PrimaryMonitor)>,
) {
for (entity, _primary_monitor) in q_primary_monitor {
commands.get_entity(entity).unwrap().log_components();
}
}
```
This snippet results in no logged components.

## What went wrong
Seems like there has been a regression, or a problem with Wayland support where Monitor entities are not being given the PrimaryMonitor component when they are the primary monitor of the system.

## Additional information
This query results in no selected entities when run at PostStartup as well
```Rust
pub fn detect_primary_monitor_settings(
mut commands: Commands,
q_primary_monitor: Query<&mut Monitor, With< PrimaryMonitor>>,
) {
for entity in q_primary_monitor {
commands.get_entity(entity).unwrap().log_components();
}
}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.