@@ -10,6 +10,7 @@ import { docksSplitGroupsWithCapacity, getEntryGroup, resolveNextRecentDockIds,
1010import { setDocksOverflowPanel , useDocksGroupPanel } from ' ../../state/floating-tooltip'
1111import { useSettings } from ' ../../state/settings-defaults'
1212import { useIsRpcTrusted } from ' ../../utils/useIsRpcTrusted'
13+ import { useSafeArea } from ' ../../utils/useSafeArea'
1314import BrandMark from ' ../icons/BrandMark.vue'
1415import {
1516 dockLayoutCssVars ,
@@ -41,22 +42,7 @@ const isSafari = navigator.userAgent.includes('Safari') && !navigator.userAgent.
4142
4243const anchorEl = useTemplateRef <HTMLDivElement >(' anchorEl' )
4344
44- const safeArea = {
45- top: ref (' ' ),
46- right: ref (' ' ),
47- bottom: ref (' ' ),
48- left: ref (' ' ),
49- }
50-
51- function updateSafeArea() {
52- if (! anchorEl .value )
53- return
54- const style = getComputedStyle (anchorEl .value )
55- safeArea .top .value = style .getPropertyValue (' --devframes-safe-area-top' )
56- safeArea .right .value = style .getPropertyValue (' --devframes-safe-area-right' )
57- safeArea .bottom .value = style .getPropertyValue (' --devframes-safe-area-bottom' )
58- safeArea .left .value = style .getPropertyValue (' --devframes-safe-area-left' )
59- }
45+ const safeArea = useSafeArea (anchorEl )
6046
6147function toNumber(value : string ) {
6248 const num = Number .parseFloat (value )
@@ -169,12 +155,10 @@ watch(selectedEntry, (entry) => {
169155onMounted (async () => {
170156 windowSize .width = window .innerWidth
171157 windowSize .height = window .innerHeight
172- updateSafeArea ()
173158
174159 useEventListener (window , ' resize' , () => {
175160 windowSize .width = window .innerWidth
176161 windowSize .height = window .innerHeight
177- updateSafeArea ()
178162 })
179163
180164 useEventListener (window , ' pointermove' , (e : PointerEvent ) => {
0 commit comments