Fixes #1814 ## Problem When a system has an NVIDIA GPU, wgpu enumerates it twice: - Via Vulkan backend: `"NVIDIA GeForce RTX 3080 Ti Laptop GPU"` - Via OpenGL backend: `"NVIDIA GeForce RTX 3080 Ti Laptop GPU/PCIe/SSE2"` The OpenGL variant includes a renderer suffix (`/PCIe/SSE2`) which causes the name-based deduplication to fail, resulting in duplicate GPU entries in Settings -> System -> About. ## Solution Add `normalize_gpu_name()` helper that strips OpenGL renderer suffixes (everything after `/`) before comparing names for deduplication. This ensures both Vulkan and OpenGL representations of the same GPU are correctly identified as duplicates. ## Changes - `cosmic-settings/src/pages/system/info.rs`: - Added `normalize_gpu_name()` function with doc comment - Modified `wgpu_graphics()` to use normalized names for `seen_names` HashSet ## Testing - [x] `cargo fmt --check` passes - [x] `cargo clippy --all-features` passes (no new warnings) - [x] `cargo test --all-features` passes (3/3 tests) - [x] `just check-features` passes - [x] Manual testing: Verified on system with NVIDIA GPU that duplicate entries no longer appear ## Checklist - [x] I have disclosed use of any AI generated code in my commit messages. - [x] I understand these changes in full and will be able to respond to review comments. - [x] My change is accurately described in the commit message. - [x] My contribution is tested and working as described. - [x] I have read the Developer Certificate of Origin and certify my contribution under its conditions. Signed-off-by: manascb1344 <zephop76593@gmail.com> |
||
|---|---|---|
| .github | ||
| .vscode | ||
| cosmic-settings | ||
| crates/cosmic-pipewire | ||
| debian | ||
| i18n | ||
| page | ||
| pages/wallpapers | ||
| resources | ||
| subscriptions | ||
| .gitattributes | ||
| .gitignore | ||
| cargo.just | ||
| Cargo.lock | ||
| Cargo.toml | ||
| flake.lock | ||
| flake.nix | ||
| justfile | ||
| LICENSE.md | ||
| README.md | ||
| rust-toolchain.toml | ||
| TESTING.md | ||
COSMIC Settings
The settings application for the COSMIC desktop environment.
Translators
Translations must go through Weblate at https://hosted.weblate.org/projects/pop-os/cosmic-settings.
Distributors
We will accept pull requests for distro-specific features and pages. Make them compile conditionally with a cargo feature.
The accent palettes on the Appearance settings page are configurable through the cosmic-config directory at /usr/share/cosmic/com.system76.CosmicSettings/v1/. One at accent_palette_dark, and another at accent_palette_light. Examples can be found at resources/accent_palette_dark.ron and resources/accent_palette_light.ron. This can be copied locally to ~/.config/cosmic/com.system76.CosmicSettings/v1/ for testing, and then move to /usr/share/cosmic for packaging.
Build
Dependencies
See the Build-Depends section of the debian control file.
Install
COSMIC uses just as its preferred build tool.
just
sudo just install
Packaging
If packaging for a Linux distribution, vendor dependencies locally with the vendor rule, and build with the vendored sources using the build-vendored rule. When installing files, use the rootdir and prefix variables to change installation paths.
just vendor
just build-vendored
just rootdir=debian/cosmic-settings prefix=/usr install
It is recommended to build a source tarball with the vendored dependencies, which can typically be done by running just vendor on the host system before it enters the build environment. Reference debian/rules to see how we generate debian packages with sbuild.
Developers
Developers should install rustup and configure their editor to use rust-analyzer. Run just check to ensure that the changes you make are free of linter warnings. You may configure your editor to run just check-json as the rust-analyzer check command.
Run the cosmic-settings binary with just run so that logs will be emitted to stderr, and crashes will generate detailed backtraces. Applications shouldn't crash, so when writing code, avoid use of unwrap() and expect(). Instead, log errors with tracing::error!() or tracing::warn!().
To improve compilation times, use Rust >= 1.90.0 and configure sccache for use with Rust.
License
Licensed under the GNU Public License 3.0.
Contribution
Any contribution intentionally submitted for inclusion in the work by you shall be licensed under the GNU Public License 3.0 (GPL-3.0). Each source file should have a SPDX copyright notice at the top of the file:
// SPDX-License-Identifier: GPL-3.0-only