From 91a0923fc4caace3bebeeee0e8c1eb126da38c0f Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Mon, 11 Mar 2024 18:07:26 +0100 Subject: [PATCH] Fix a few regressions related to the flicker fix (#9190) This pull request fixes https://github.com/zed-industries/zed/issues/9187 and fixes also ix a rendering problem that would show cursors on the same plane: ![image](https://github.com/zed-industries/zed/assets/482957/208304a4-286a-4fd9-a3d8-e2913e3a3dc7) Release Notes: - N/A --- crates/editor/src/element.rs | 8 +++----- crates/workspace/src/modal_layer.rs | 26 ++++++++++++++++---------- 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/crates/editor/src/element.rs b/crates/editor/src/element.rs index 187a23537ec68cf323ce91ed226af4e916a5f4ac..7faa67162772d849838c73bdf28f3280b090c98b 100644 --- a/crates/editor/src/element.rs +++ b/crates/editor/src/element.rs @@ -2083,11 +2083,9 @@ impl EditorElement { } fn paint_cursors(&mut self, layout: &mut EditorLayout, cx: &mut ElementContext) { - cx.paint_layer(layout.text_hitbox.bounds, |cx| { - for cursor in &mut layout.cursors { - cursor.paint(layout.content_origin, cx); - } - }); + for cursor in &mut layout.cursors { + cursor.paint(layout.content_origin, cx); + } } fn paint_scrollbar(&mut self, layout: &mut EditorLayout, cx: &mut ElementContext) { diff --git a/crates/workspace/src/modal_layer.rs b/crates/workspace/src/modal_layer.rs index db67e1618a2047f7a5105811fafe402f2f03bddc..8208d808e9012f72ca2cd10041a0885264837cf8 100644 --- a/crates/workspace/src/modal_layer.rs +++ b/crates/workspace/src/modal_layer.rs @@ -139,15 +139,21 @@ impl Render for ModalLayer { return div(); }; - div().absolute().size_full().top_0().left_0().child( - v_flex() - .h(px(0.0)) - .top_20() - .flex() - .flex_col() - .items_center() - .track_focus(&active_modal.focus_handle) - .child(h_flex().child(active_modal.modal.view())), - ) + div() + .occlude() + .absolute() + .size_full() + .top_0() + .left_0() + .child( + v_flex() + .h(px(0.0)) + .top_20() + .flex() + .flex_col() + .items_center() + .track_focus(&active_modal.focus_handle) + .child(h_flex().child(active_modal.modal.view())), + ) } }