Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ libcosmic = { git = "https://github.com/pop-os/libcosmic", default-features = fa
] }
rust-embed = "8.7.2"
rust-embed-utils = "8.7.2"
rustc-hash = "2.1"
rustix = { version = "1.1", features = ["fs", "process"] }
zbus = { version = "5.11.0", default-features = false, features = ["tokio"] }
tracing = "0.1"
Expand Down
1 change: 1 addition & 0 deletions cosmic-app-list/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ memmap2 = "0.9.8"
fastrand = "2.3.0"
rust-embed.workspace = true
rustix.workspace = true
rustc-hash.workspace = true
switcheroo-control = { git = "https://github.com/pop-os/dbus-settings-bindings" }
tokio.workspace = true
tracing-log.workspace = true
Expand Down
7 changes: 4 additions & 3 deletions cosmic-app-list/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ use cosmic_app_list_config::{APP_ID, AppListConfig};
use cosmic_protocols::toplevel_info::v1::client::zcosmic_toplevel_handle_v1::State;
use futures::future::pending;
use iced::{Alignment, Background, Length};
use std::{borrow::Cow, collections::HashMap, path::PathBuf, rc::Rc, str::FromStr, time::Duration};
use rustc_hash::FxHashMap;
use std::{borrow::Cow, path::PathBuf, rc::Rc, str::FromStr, time::Duration};
use switcheroo_control::Gpu;
use tokio::time::sleep;
use url::Url;
Expand Down Expand Up @@ -327,12 +328,12 @@ struct CosmicAppList {
wayland_sender: Option<Sender<WaylandRequest>>,
seat: Option<WlSeat>,
rectangle_tracker: Option<RectangleTracker<DockItemId>>,
rectangles: HashMap<DockItemId, iced::Rectangle>,
rectangles: FxHashMap<DockItemId, iced::Rectangle>,
dnd_offer: Option<DndOffer>,
is_listening_for_dnd: bool,
gpus: Option<Vec<Gpu>>,
active_workspaces: Vec<ExtWorkspaceHandleV1>,
output_list: HashMap<WlOutput, OutputInfo>,
output_list: FxHashMap<WlOutput, OutputInfo>,
locales: Vec<String>,
overflow_favorites_popup: Option<window::Id>,
overflow_active_popup: Option<window::Id>,
Expand Down
1 change: 1 addition & 0 deletions cosmic-applet-battery/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ i18n-embed-fl.workspace = true
i18n-embed.workspace = true
libcosmic.workspace = true
rust-embed.workspace = true
rustc-hash.workspace = true
tokio.workspace = true
tracing-log.workspace = true
tracing-subscriber.workspace = true
Expand Down
5 changes: 3 additions & 2 deletions cosmic-applet-battery/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ use cosmic_settings_subscriptions::{
};
use cosmic_time::{Instant, Timeline, anim, chain, id};

use std::{collections::HashMap, path::PathBuf, sync::LazyLock, time::Duration};
use rustc_hash::FxHashMap;
use std::{path::PathBuf, sync::LazyLock, time::Duration};
use tokio::sync::mpsc::UnboundedSender;

// XXX improve
Expand Down Expand Up @@ -80,7 +81,7 @@ struct CosmicBatteryApplet {
charging_limit: Option<bool>,
battery_percent: f64,
on_battery: bool,
gpus: HashMap<PathBuf, GPUData>,
gpus: FxHashMap<PathBuf, GPUData>,
update_trigger: Option<UnboundedSender<()>>,
time_remaining: Duration,
max_kbd_brightness: Option<i32>,
Expand Down
1 change: 1 addition & 0 deletions cosmic-applet-bluetooth/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ i18n-embed.workspace = true
libcosmic.workspace = true
fastrand = "2.3.0"
rust-embed.workspace = true
rustc-hash.workspace = true
tokio.workspace = true
tracing-log.workspace = true
tracing-subscriber.workspace = true
Expand Down
7 changes: 4 additions & 3 deletions cosmic-applet-bluetooth/src/bluetooth.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
// Copyright 2023 System76 <[email protected]>
// SPDX-License-Identifier: GPL-3.0-only

use rustc_hash::FxHashMap;

use std::{
collections::{HashMap, HashSet},
fmt::Debug,
hash::Hash,
mem,
Expand Down Expand Up @@ -357,7 +358,7 @@ pub struct BluerSessionState {
wake_up_discover_tx: Sender<()>,
wake_up_discover_rx: Option<Receiver<()>>,
tx: Sender<BluerSessionEvent>,
active_requests: Arc<Mutex<HashMap<BluerRequest, JoinHandle<anyhow::Result<()>>>>>,
active_requests: Arc<Mutex<FxHashMap<BluerRequest, JoinHandle<anyhow::Result<()>>>>>,
}

impl BluerSessionState {
Expand Down Expand Up @@ -540,7 +541,7 @@ impl BluerSessionState {
wake_up_discover_rx: Some(wake_up_discover_rx),
wake_up_discover_tx,
tx,
active_requests: Arc::new(Mutex::new(HashMap::new())),
active_requests: Default::default(),
};
self_.process_requests(req_rx);
self_.process_changes();
Expand Down
1 change: 1 addition & 0 deletions cosmic-applet-network/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ libcosmic = { workspace = true, features = [
"desktop",
] }
rust-embed.workspace = true
rustc-hash.workspace = true
tokio.workspace = true
tracing-log.workspace = true
tracing-subscriber.workspace = true
Expand Down
4 changes: 2 additions & 2 deletions cosmic-applet-network/src/app.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::collections::HashSet;
use rustc_hash::FxHashSet;
use std::sync::LazyLock;

use cosmic::{
Expand Down Expand Up @@ -107,7 +107,7 @@ struct CosmicNetworkApplet {
timeline: Timeline,
toggle_wifi_ctr: u128,
token_tx: Option<calloop::channel::Sender<TokenRequest>>,
failed_known_ssids: HashSet<String>,
failed_known_ssids: FxHashSet<String>,
hw_device_to_show: Option<HwAddress>,
}

Expand Down
3 changes: 2 additions & 1 deletion cosmic-applet-network/src/network_manager/available_wifi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ use cosmic_dbus_networkmanager::{
};

use futures_util::StreamExt;
use rustc_hash::FxHashMap;
use std::collections::HashMap;
use zbus::zvariant::ObjectPath;

Expand All @@ -34,7 +35,7 @@ pub async fn handle_wireless_device(
.unwrap_or_default()
.map_or(DeviceState::Unknown, |s| s.into());
// Sort by strength and remove duplicates
let mut aps = HashMap::<String, AccessPoint>::new();
let mut aps = FxHashMap::<String, AccessPoint>::default();
for ap in access_points {
let ssid = String::from_utf8_lossy(ap.ssid().await?.as_slice()).into_owned();
let wps_push = ap.flags().await?.contains(ApFlags::WPS_PBC);
Expand Down
1 change: 1 addition & 0 deletions cosmic-applet-status-area/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ license = "GPL-3.0-only"
futures.workspace = true
libcosmic.workspace = true
serde.workspace = true
rustc-hash.workspace = true
tokio.workspace = true
tracing.workspace = true
tracing-log.workspace = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

use cosmic::iced::{self, Subscription};
use futures::{FutureExt, StreamExt};
use std::collections::HashMap;
use rustc_hash::FxHashMap;
use zbus::zvariant::{self, OwnedValue};

#[derive(Clone, Debug)]
Expand Down Expand Up @@ -153,8 +153,11 @@ impl<'a> serde::Deserialize<'a> for Layout {
}

impl zvariant::Type for Layout {
const SIGNATURE: &'static zvariant::Signature =
<(i32, HashMap<String, zvariant::Value>, Vec<zvariant::Value>)>::SIGNATURE;
const SIGNATURE: &zvariant::Signature = <(
i32,
FxHashMap<String, zvariant::Value>,
Vec<zvariant::Value>,
)>::SIGNATURE;
}

#[derive(Clone, Debug, zvariant::DeserializeDict)]
Expand Down Expand Up @@ -184,7 +187,7 @@ pub struct LayoutProps {
}

impl zvariant::Type for LayoutProps {
const SIGNATURE: &'static zvariant::Signature = <HashMap<String, zvariant::Value>>::SIGNATURE;
const SIGNATURE: &zvariant::Signature = <FxHashMap<String, zvariant::Value>>::SIGNATURE;
}

#[allow(dead_code)]
Expand Down
1 change: 1 addition & 0 deletions cosmic-applet-tiling/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ cosmic-time.workspace = true
i18n-embed-fl.workspace = true
i18n-embed.workspace = true
rust-embed.workspace = true
rustc-hash.workspace = true
tokio.workspace = true
tracing-log.workspace = true
tracing-subscriber.workspace = true
Expand Down
14 changes: 6 additions & 8 deletions cosmic-applet-tiling/src/wayland.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,10 @@ use cctk::{
use cosmic::iced::futures;
use cosmic_protocols::workspace::v2::client::zcosmic_workspace_handle_v2::TilingState;
use futures::{SinkExt, channel::mpsc, executor::block_on};
use std::{
collections::HashSet,
os::{
fd::{FromRawFd, RawFd},
unix::net::UnixStream,
},
use rustc_hash::FxHashSet;
use std::os::{
fd::{FromRawFd, RawFd},
unix::net::UnixStream,
};
use tracing::error;
use wayland_client::{
Expand Down Expand Up @@ -79,7 +77,7 @@ pub fn spawn_workspaces(tx: mpsc::Sender<TilingState>) -> SyncSender<AppRequest>
configured_output,
workspace_state: WorkspaceState::new(&registry_state, &qhandle),
toplevel_info_state: ToplevelInfoState::new(&registry_state, &qhandle),
workspaces_with_previous_toplevel: HashSet::new(),
workspaces_with_previous_toplevel: FxHashSet::default(),
registry_state,
expected_output: None,
tx,
Expand Down Expand Up @@ -167,7 +165,7 @@ pub struct State {
registry_state: RegistryState,
workspace_state: WorkspaceState,
toplevel_info_state: ToplevelInfoState,
workspaces_with_previous_toplevel: HashSet<ext_workspace_handle_v1::ExtWorkspaceHandleV1>,
workspaces_with_previous_toplevel: FxHashSet<ext_workspace_handle_v1::ExtWorkspaceHandleV1>,
have_workspaces: bool,
}

Expand Down
1 change: 1 addition & 0 deletions cosmic-panel-button/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ license = "GPL-3.0-only"

[dependencies]
libcosmic.workspace = true
rustc-hash.workspace = true
tracing.workspace = true
tracing-subscriber.workspace = true
tracing-log.workspace = true
Expand Down
6 changes: 3 additions & 3 deletions cosmic-panel-button/src/config.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::collections::HashMap;
use rustc_hash::FxHashMap;

use cosmic_config::{CosmicConfigEntry, cosmic_config_derive::CosmicConfigEntry};
use serde::{Deserialize, Serialize};
Expand All @@ -8,13 +8,13 @@ use serde::{Deserialize, Serialize};
#[serde(deny_unknown_fields)]
pub struct CosmicPanelButtonConfig {
/// configs indexed by panel name
pub configs: HashMap<String, IndividualConfig>,
pub configs: FxHashMap<String, IndividualConfig>,
}

impl Default for CosmicPanelButtonConfig {
fn default() -> Self {
Self {
configs: HashMap::from([
configs: FxHashMap::from_iter([
(
"Panel".to_string(),
IndividualConfig {
Expand Down
Loading