Skip to content

Commit

Permalink
refactor: add namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
wash2 committed Nov 27, 2024
1 parent 60558e1 commit cbd7f3b
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 28 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

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

58 changes: 37 additions & 21 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,49 +6,65 @@ name = "cosmic-comp"
version = "0.1.0"

[workspace]
members = [
"cosmic-comp-config",
]
members = ["cosmic-comp-config"]

[dependencies]
anyhow = {version = "1.0.51", features = ["backtrace"]}
anyhow = { version = "1.0.51", features = ["backtrace"] }
bitflags = "2.4"
bytemuck = "1.12"
calloop = {version = "0.14.1", features = ["executor"]}
cosmic-comp-config = {path = "cosmic-comp-config"}
cosmic-config = {git = "https://github.com/pop-os/libcosmic/", features = ["calloop", "macro"]}
cosmic-protocols = {git = "https://github.com/pop-os/cosmic-protocols", branch = "main", default-features = false, features = ["server"]}
calloop = { version = "0.14.1", features = ["executor"] }
cosmic-comp-config = { path = "cosmic-comp-config" }
cosmic-config = { git = "https://github.com/pop-os/libcosmic/", features = [
"calloop",
"macro",
] }
cosmic-protocols = { git = "https://github.com/pop-os/cosmic-protocols", branch = "overlap-namespace", default-features = false, features = [
"server",
] }
cosmic-settings-config = { git = "https://github.com/pop-os/cosmic-settings-daemon" }
edid-rs = {version = "0.1"}
egui = {version = "0.29.0", optional = true}
egui_plot = {version = "0.29.0", optional = true}
edid-rs = { version = "0.1" }
egui = { version = "0.29.0", optional = true }
egui_plot = { version = "0.29.0", optional = true }
glow = "0.12.0"
i18n-embed = {version = "0.14", features = ["fluent-system", "desktop-requester"]}
i18n-embed = { version = "0.14", features = [
"fluent-system",
"desktop-requester",
] }
i18n-embed-fl = "0.8"
iced_tiny_skia = {git = "https://github.com/pop-os/libcosmic/"}
iced_tiny_skia = { git = "https://github.com/pop-os/libcosmic/" }
indexmap = "2.0"
keyframe = "1.1.1"
lazy_static = "1.4.0"
libc = "0.2.149"
libcosmic = {git = "https://github.com/pop-os/libcosmic/", default-features = false}
libsystemd = {version = "0.7", optional = true}
log-panics = {version = "2", features = ["with-backtrace"]}
libcosmic = { git = "https://github.com/pop-os/libcosmic/", default-features = false }
libsystemd = { version = "0.7", optional = true }
log-panics = { version = "2", features = ["with-backtrace"] }
once_cell = "1.18.0"
ordered-float = "4.0"
png = "0.17.5"
regex = "1"
ron = "0.8"
rust-embed = {version = "8.0", features = ["debug-embed"]}
rust-embed = { version = "8.0", features = ["debug-embed"] }
sanitize-filename = "0.5.0"
sendfd = "0.4.1"
serde = {version = "1", features = ["derive"]}
serde = { version = "1", features = ["derive"] }
serde_json = "1"
thiserror = "1.0.26"
time = {version = "0.3.30", features = ["macros", "formatting", "local-offset"]}
time = { version = "0.3.30", features = [
"macros",
"formatting",
"local-offset",
] }
tiny-skia = "0.11"
tracing = { version = "0.1.37", features = ["max_level_debug", "release_max_level_info"] }
tracing = { version = "0.1.37", features = [
"max_level_debug",
"release_max_level_info",
] }
tracing-journald = "0.3.0"
tracing-subscriber = {version = "0.3.16", features = ["env-filter", "tracing-log"]}
tracing-subscriber = { version = "0.3.16", features = [
"env-filter",
"tracing-log",
] }
wayland-backend = "0.3.3"
wayland-scanner = "0.31.1"
xcursor = "0.3.3"
Expand Down
25 changes: 19 additions & 6 deletions src/wayland/protocols/overlap_notify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,12 @@ impl LayerOverlapNotificationDataInternal {
}
}
}
for (_, (identifier, exclusive, layer, overlap)) in &self.last_snapshot.layer_overlaps {
for (_, (identifier, namespace, exclusive, layer, overlap)) in
&self.last_snapshot.layer_overlaps
{
new_notification.layer_enter(
identifier.clone(),
namespace.clone(),
if *exclusive { 1 } else { 0 },
match layer {
Layer::Background => WlrLayer::Background,
Expand Down Expand Up @@ -257,17 +260,19 @@ impl LayerOverlapNotificationDataInternal {
}
}
}
for (layer_surface, (identifier, exclusive, layer, overlap)) in &new_snapshot.layer_overlaps
for (layer_surface, (identifier, namespace, exclusive, layer, overlap)) in
&new_snapshot.layer_overlaps
{
if !self
.last_snapshot
.layer_overlaps
.get(layer_surface)
.is_some_and(|(_, _, _, old_overlap)| old_overlap == overlap)
.is_some_and(|(_, _, _, _, old_overlap)| old_overlap == overlap)
{
for notification in &notifications {
notification.layer_enter(
identifier.clone(),
namespace.clone(),
if *exclusive { 1 } else { 0 },
match layer {
Layer::Background => WlrLayer::Background,
Expand All @@ -291,7 +296,7 @@ impl LayerOverlapNotificationDataInternal {
#[derive(Debug, Default, Clone)]
struct OverlapSnapshot {
toplevel_overlaps: HashMap<Weak<ExtForeignToplevelHandleV1>, Rectangle<i32, Logical>>,
layer_overlaps: HashMap<ObjectId, (String, bool, Layer, Rectangle<i32, Logical>)>,
layer_overlaps: HashMap<ObjectId, (String, String, bool, Layer, Rectangle<i32, Logical>)>,
}

impl OverlapSnapshot {
Expand Down Expand Up @@ -322,8 +327,16 @@ impl OverlapSnapshot {
.user_data()
.get_or_insert(|| Identifier::from(id.clone()));

self.layer_overlaps
.insert(id, (identifier.0.clone(), exclusive, layer, overlap));
self.layer_overlaps.insert(
id,
(
identifier.0.clone(),
layer_surface.namespace().to_string(),
exclusive,
layer,
overlap,
),
);
}
}

Expand Down

0 comments on commit cbd7f3b

Please sign in to comment.