Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: add namespace #1018

Merged
merged 1 commit into from
Nov 27, 2024
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
12 changes: 6 additions & 6 deletions Cargo.lock

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

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