Popovers icon indicating copy to clipboard operation
Popovers copied to clipboard

Bound preference ContentFrameReaderPreferenceKey tried to update multiple times per frame.

Open wisepmlin opened this issue 2 years ago • 7 comments

wisepmlin avatar Jan 05 '22 07:01 wisepmlin

I've seen this when using a ScrollView sometimes. It's probably due to this code:

https://github.com/aheze/Popovers/blob/499954f2dcad9167ac01ee3051f7fbd00d3f6fd2/Sources/PopoverUtilities.swift#L28-L43

I tried to fix it with the DispatchQueue.main.async { }, but apparently that didn't work completely. However it's really just console noise and shouldn't actually crash your app, so it's lower priority. I'll look into it though.

aheze avatar Jan 05 '22 15:01 aheze

Adding popover to the list will cause the refresh of the list to stutter and drop frames

wisepmlin avatar Mar 21 '22 06:03 wisepmlin

Could have something to do with the WindowReader

aheze avatar Mar 22 '22 19:03 aheze

How to try and optimize this type of problem

wisepmlin avatar Mar 27 '22 17:03 wisepmlin

I’m not sure. But I’m currently trying to debug the dismissal and positioning transactions. That could be related

aheze avatar Mar 27 '22 17:03 aheze

 ZStack{
                        Button(action: {
                            present.toggle()
                        }, label: {
                            menuButton(onOf: present)
                                .onChange(of: present, perform: {
                                    value in
                                    selectedRow = value
                                })
                        })
                        .onChange(of: present, perform: {
                            value in
                            //以防万一,确保异步延迟在操作一次,防止显示弹出框时未找到任何窗口
                            DispatchQueue.main.asyncAfter(deadline: .now() + 0.05) {
                                present_t = value
                            }
                        })
                        .onChange(of: present_t, perform: {
                            value in
                            if !value {
                                //以防万一,确保异步延迟在操作一次,防止显示弹出框时未找到任何窗口
                                DispatchQueue.main.asyncAfter(deadline: .now() + 0.05) {
                                    present = value
                                }
                            }
                        })
                        if present {
                            taskRowToolMenu
                        }
                    }

wisepmlin avatar Apr 04 '22 07:04 wisepmlin

Will be fixed in v1.4.0, coming in a couple weeks

aheze avatar Aug 21 '22 16:08 aheze