goabstract / electron-panel-window

Enables creating a browser window in Electron that behaves like an NSPanel.
MIT License
56 stars 17 forks source link

macOS 10.16 (Big Sur) support #6

Open tommoor opened 4 years ago

tommoor commented 4 years ago

Module causes crash on Big Sur, possibly related to this Radar: http://www.openradar.appspot.com/7483151 – dynamically setting the styleMask is somehow the cause.

Crashed Thread:        0  CrBrowserMain  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_BAD_INSTRUCTION (SIGILL)
Exception Codes:       0x0000000000000001, 0x0000000000000000
Exception Note:        EXC_CORPSE_NOTIFY

Termination Signal:    Illegal instruction: 4
Termination Reason:    Namespace SIGNAL, Code 0x4
Terminating Process:   exc handler [55604]

Application Specific Information:
Crashing on exception: Cannot remove an observer <NSTitlebarView 0x7fdbcba56190> for the key path "_titlebarBackdropGroupName" from <PROPanel 0x7fdbcba29590> because it is not registered as an observer.

Application Specific Backtrace 1:
0   CoreFoundation                      0x00007fff27a1736f __exceptionPreprocess + 242
1   libobjc.A.dylib                     0x00007fff66416a56 objc_exception_throw + 48
2   Foundation                          0x00007fff2a314adb -[NSObject(NSKeyValueObserverRegistration) _removeObserver:forProperty:] + 564
3   Foundation                          0x00007fff2a31485c -[NSObject(NSKeyValueObserverRegistration) removeObserver:forKeyPath:] + 74
4   Foundation                          0x00007fff2a314539 -[NSObject(NSKeyValueObserverRegistration) removeObserver:forKeyPath:context:] + 190
5   AppKit                              0x00007fff252a7175 -[NSTitlebarView viewWillMoveToWindow:] + 73
6   AppKit                              0x00007fff248f13b3 -[NSView _setWindow:] + 247
7   AppKit                              0x00007fff2514caf4 __21-[NSView _setWindow:]_block_invoke.426 + 300
8   AppKit                              0x00007fff248f198f -[NSView _setWindow:] + 1747
9   AppKit                              0x00007fff2514caf4 __21-[NSView _setWindow:]_block_invoke.426 + 300
10  AppKit                              0x00007fff248f198f -[NSView _setWindow:] + 1747
11  AppKit                              0x00007fff2492b2cd __25-[NSWindow setStyleMask:]_block_invoke + 513
12  AppKit                              0x00007fff2492b071 NSPerformVisuallyAtomicChange + 132
13  AppKit                              0x00007fff2492af7b -[NSWindow setStyleMask:] + 170
14  NativeExtension.node                0x00000001135a3a90 _Z9MakePanelRKN3Nan20FunctionCallbackInfoIN2v85ValueEEE + 149
15  NativeExtension.node                0x00000001135a39da _ZN3Nan3impL23FunctionCallbackWrapperERKN2v820FunctionCallbackInfoINS1_5ValueEEE + 188
16  Electron Framework                  0x0000000107c57c3c _ZN2v88internal9Accessors12MakeAccessorEPNS0_7IsolateENS0_6HandleINS0_4NameEEEPFvNS_5LocalINS_4NameEEERKNS_20PropertyCallbackInfoINS_5ValueEEEEPFvS9_NS7_ISB_EERKNSA_INS_7BooleanEEEE + 16844
17  Electron Framework                  0x0000000107c5713a _ZN2v88internal9Accessors12MakeAccessorEPNS0_7IsolateENS0_6HandleINS0_4NameEEEPFvNS_5LocalINS_4NameEEERKNS_20PropertyCallbackInfoINS_5ValueEEEEPFvS9_NS7_ISB_EERKNSA_INS_7BooleanEEEE + 14026
jameshfisher commented 4 years ago

10.15 == Catalina. 11.0 == Big Sur. Not sure which this refers to

Syed-Umair commented 4 years ago

Hi Team, I am also facing the same issue, it crashes on opening the panel window in BigSur.

tommoor commented 4 years ago

We've been unable to find a solution for this crash – So far it looks like the changes to the titlebar in Big Sur make this module impossible to update to be compatible going forward. The approach was always hacky to get around the limitations of Electron, but those hacks no longer work.

It's so sad that after all this time Electron still has no native way to create an NSPanel 😢

Syed-Umair commented 4 years ago

We've been unable to find a solution for this crash – So far it looks like the changes to the titlebar in Big Sur make this module impossible to update to be compatible going forward. The approach was always hacky to get around the limitations of Electron, but those hacks no longer work.

It's so sad that after all this time Electron still has no native way to create an NSPanel 😢

Yes @tommoor agreed, it would be really great if electron supports this by default.

viveknair commented 4 years ago

It was great while it lasted @tommoor

Great work overall! We really enjoyed using this native module.

ibash commented 4 years ago

Was poking around the WhatsApp desktop app which is electron. It looks like they started with electron-panel-window, but completely rewrote it.

This is what their api looks like: https://gist.github.com/ibash/2c9894a8038b71456aeabe413e532c19

What I'm not sure about is whether their panel works on Big Sur or not, I'm not sure where (if anywhere) their panel is used in the app.