So lange das Problem nicht gelöst wurde, habe ich ein Workaround dafür.
Das OS merkt sich die Einstellung für die Applikation. Möchte man die Touchbar verwenden, muss diese auch wieder aktiviert werden.
Update v1.03
Code: Alles auswählen
;-TOP
; Touchbar workaround by mk-soft
; Version v1.03
; Date 08/15/2017
Procedure IsTouchbar()
Protected standardUserDefaults, r1
standardUserDefaults = CocoaMessage(0, 0, "NSUserDefaults standardUserDefaults")
r1 = CocoaMessage(0, standardUserDefaults, "integerForKey:$", @"NSFunctionBarAPIEnabled")
ProcedureReturn r1
EndProcedure
Procedure DisableTouchbar()
Protected standardUserDefaults
If IsTouchbar()
standardUserDefaults = CocoaMessage(0, 0, "NSUserDefaults standardUserDefaults")
CocoaMessage(0, standardUserDefaults, "setBool:", #NO, "forKey:$", @"NSFunctionBarAPIEnabled")
RunProgram(ProgramFilename(), ProgramParameter(), GetCurrentDirectory())
End
EndIf
EndProcedure
Procedure EnableTouchbar()
Protected standardUserDefaults
If IsTouchbar() = 0
standardUserDefaults = CocoaMessage(0, 0, "NSUserDefaults standardUserDefaults")
CocoaMessage(0, standardUserDefaults, "setBool:", #YES, "forKey:$", @"NSFunctionBarAPIEnabled")
RunProgram(ProgramFilename(), ProgramParameter(), GetCurrentDirectory())
End
EndIf
EndProcedure
; ***************************************************************************************
CompilerIf #PB_Compiler_IsMainFile
DisableTouchbar()
If OpenWindow(0, 0, 0, 600, 300, "WebGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
Delay(100)
; this website doesn't crash the app
;WebGadget(0, 10, 10, 580, 280, "http://www.apple.com")
; this website crashes the app
WebGadget(0, 10, 10, 580, 280, "http://google.com")
Repeat
; crash with "http://google.com"
Until WaitWindowEvent() = #PB_Event_CloseWindow ; <- Invalid memory access
EndIf
CompilerEndIf