core: layer deferred surfaces with draw priorities
This commit is contained in:
+11
-6
@@ -15,7 +15,7 @@ use gpui_native_icons::{Icon, IconRole, icon as icon_glyph};
|
||||
use gpui_native_theme::{ActiveTheme as _, BORDER_WIDTH, POPUP_MAX_HEIGHT};
|
||||
use gpui_native_utils::focus_handle;
|
||||
|
||||
use crate::common::v_flex;
|
||||
use crate::common::{OVERLAY_LAYER, v_flex};
|
||||
use crate::scroll_area::{ScrollArea, ScrollAxes};
|
||||
|
||||
/// Runs the item's action. The menu closes itself before the handler runs.
|
||||
@@ -557,7 +557,11 @@ pub(crate) fn anchored_menu_panel(
|
||||
}
|
||||
.offset(point(px(0.), chrome.spacing_unit));
|
||||
|
||||
Some(deferred(anchored.child(panel)).into_any_element())
|
||||
Some(
|
||||
deferred(anchored.child(panel))
|
||||
.with_priority(OVERLAY_LAYER)
|
||||
.into_any_element(),
|
||||
)
|
||||
}
|
||||
|
||||
/// Builds one menu panel: chrome, rows, focus, navigation, and dismissals.
|
||||
@@ -894,8 +898,8 @@ fn render_item(
|
||||
.absolute()
|
||||
.inset_0(),
|
||||
)
|
||||
.child(deferred(
|
||||
div().absolute().left_full().top_0().child(menu_panel(
|
||||
.child(
|
||||
deferred(div().absolute().left_full().top_0().child(menu_panel(
|
||||
window,
|
||||
cx,
|
||||
flyout.state,
|
||||
@@ -916,8 +920,9 @@ fn render_item(
|
||||
enter_duration: flyout.enter_duration,
|
||||
debug_prefix: "submenu",
|
||||
},
|
||||
)),
|
||||
))
|
||||
)))
|
||||
.with_priority(OVERLAY_LAYER),
|
||||
)
|
||||
})
|
||||
.into_any_element()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user