Skip to content

Commit 8c3ea37

Browse files
authored
fix: fix #140. (#143)
revert `4579a47a6c1f6a571e670693957fc7561106893d`.
1 parent 5a47b5f commit 8c3ea37

File tree

1 file changed

+0
-29
lines changed

1 file changed

+0
-29
lines changed

iced_layershell/src/multi_window.rs

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -554,13 +554,6 @@ async fn run_instance<A, E, C>(
554554
let mut should_exit = false;
555555
let mut messages = Vec::new();
556556

557-
// record the last window id, when window is removed, we compare the id with the last id, to
558-
// find out if the current surface binding with the compositor is dead, if so, update the
559-
// compositor with the alive one
560-
let mut last_id = None;
561-
// mark if compositor needs to be updated
562-
let mut compositor_to_be_updated = true;
563-
564557
while let Some(event) = event_receiver.next().await {
565558
waiting_actions.retain(|(id, custom_action)| {
566559
let Some(layerid) = window_manager.get_layer_id(*id) else {
@@ -603,8 +596,6 @@ async fn run_instance<A, E, C>(
603596
if compositor.is_none() {
604597
replace_compositor!(wrapper);
605598
clipboard = LayerShellClipboard::connect(&wrapper);
606-
compositor_to_be_updated = false;
607-
last_id = Some(id);
608599
}
609600

610601
let window = window_manager.insert(
@@ -655,15 +646,6 @@ async fn run_instance<A, E, C>(
655646
ui.relayout(window.state.logical_size(), &mut window.renderer),
656647
);
657648
}
658-
// NOTE: if compositor need to be updated, use the first be refreshed one to
659-
// update it
660-
if compositor_to_be_updated {
661-
let wrapper = Arc::new(wrapper);
662-
replace_compositor!(wrapper);
663-
clipboard = LayerShellClipboard::connect(&wrapper);
664-
last_id = Some(id);
665-
compositor_to_be_updated = false;
666-
}
667649
(id, window)
668650
};
669651
let compositor = compositor
@@ -928,18 +910,7 @@ async fn run_instance<A, E, C>(
928910
if window_manager.is_empty() {
929911
compositor = None;
930912
clipboard = LayerShellClipboard::unconnected();
931-
compositor_to_be_updated = true;
932-
continue;
933-
}
934-
935-
// NOTE: if current binding surface is still alive, we do not need to update the
936-
// compositor
937-
if let Some(last_id) = last_id {
938-
if last_id != id {
939-
continue;
940-
}
941913
}
942-
compositor_to_be_updated = true;
943914
}
944915
MultiWindowIcedLayerEvent(
945916
Some(id),

0 commit comments

Comments
 (0)