Skip to content

PrimaryMonitor component not added to any Monitor entities #21777

@sollambert

Description

@sollambert

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.

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

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();
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-WindowingPlatform-agnostic interface layer to run your app inC-BugAn unexpected or incorrect behaviorD-StraightforwardSimple bug fixes and API improvements, docs, test and examplesS-Ready-For-ImplementationThis issue is ready for an implementation PR. Go for it!

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions