Skip to content

Expose .with_class() in WindowDescriptor after new winit release to allow setting window class on X11 and app_id on Wayland. #4188

@heavyrain266

Description

@heavyrain266

What problem does this solve or what need does it fill?

Field .with_app_id() is used to set App's ID to be accessed by Compositor to e.g. set specific rules for given window or group of windows under same id, for example enabling/disabling server-side opacity, disabling CSD, hardcoding tag/workspace on startup, setting position etc.

What solution would you like?

use bevy::prelude::*;

fn main() {
    App::new()
        .insert_resource(
            WindowDescriptor {
                title: "Game Title".into(),
                // Value should be not have spaces, can be e.g. org.bevy.gameTitle (like in GTK) or anything else.
                app_id: "game_title".into(),
            
               ..Default::default()
            }
        )
        .run();
}

What alternative(s) have you considered?

None.

Additional context

For now, every bevy game have app_id exposed as <NULL>, there are programs like lswt or waylevel for querying info about connected clients and their app_id, programs like that may not work under KDE/GNOME if they don't implement protocols which allow clients to query such info from Compositor.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-WindowingPlatform-agnostic interface layer to run your app inC-FeatureA new feature, making something new possibleO-LinuxSpecific to the Linux desktop operating system

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions