Hi Josep,
I finally got around to installing macOS Sierra 10.12, and I can reproduce the problem inside the Quartam Reports Layout Builder application.
This was built with the LiveCode version of the same era, and it too exhibits the ghost window issue when repeatedly previewing+printing the Samples.
Hiding the application and showing it again displayed the ghost window with an incomplete Page Setup dialog, and when I cancelled out of that, it just crashed.
Then I tried to reproduce it inside the LiveCode 4.6.4 IDE - and the same thing happened after numerous attempts.
The stack trace is a bit too long to paste here completely, but this part is relevant:
Code: Select all
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x0000000062694c2f
Exception Note: EXC_CORPSE_NOTIFY
VM Regions Near 0x62694c2f:
mapped file 0000000017782000-0000000019009000 [ 24.5M] r--/r-x SM=ALI
-->
Submap 0000000090000000-00000000a3800000 [312.0M] r--/rwx SM=SHM machine-wide VM submap
Application Specific Information:
objc_msgSend() selector name: performSelector:withObject:
Performing @selector(doCancel:) from sender NSButton 0xeff2720
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 libobjc.A.dylib 0x9ef2c017 objc_msgSend + 23
1 libsystem_trace.dylib 0x9f9b2284 _os_activity_initiate + 79
2 com.apple.AppKit 0x92ce23a0 -[NSApplication(NSResponder) sendAction:to:from:] + 584
3 com.apple.AppKit 0x927c7256 -[NSControl sendAction:to:] + 85
4 com.apple.AppKit 0x927c716c __26-[NSCell _sendActionFrom:]_block_invoke + 151
5 libsystem_trace.dylib 0x9f9b2284 _os_activity_initiate + 79
6 com.apple.AppKit 0x927c70af -[NSCell _sendActionFrom:] + 120
7 com.apple.AppKit 0x9280752c -[NSButtonCell _sendActionFrom:] + 105
8 com.apple.AppKit 0x929fd3bc __48-[NSCell trackMouse:inRect:ofView:untilMouseUp:]_block_invoke.1101 + 35
9 libsystem_trace.dylib 0x9f9b2284 _os_activity_initiate + 79
10 com.apple.AppKit 0x927c59bf -[NSCell trackMouse:inRect:ofView:untilMouseUp:] + 2390
11 com.apple.AppKit 0x92807273 -[NSButtonCell trackMouse:inRect:ofView:untilMouseUp:] + 796
12 com.apple.AppKit 0x927c42c7 -[NSControl mouseDown:] + 686
13 com.apple.AppKit 0x92e5471f -[NSWindow(NSEventRouting) _handleMouseDownEvent:isDelayedEvent:] + 5864
14 com.apple.AppKit 0x92e521db -[NSWindow(NSEventRouting) _reallySendEvent:isDelayedEvent:] + 5876
15 com.apple.AppKit 0x92e50769 -[NSWindow(NSEventRouting) sendEvent:] + 547
16 com.apple.AppKit 0x92e4636e carbonAppWindowMouseHandler + 249
17 com.apple.AppKit 0x92e44d0d carbonAppWindowHandler + 335
18 com.apple.HIToolbox 0x93de402e _InvokeEventHandlerUPP(OpaqueEventHandlerCallRef*, OpaqueEventRef*, void*, long (*)(OpaqueEventHandlerCallRef*, OpaqueEventRef*, void*)) + 26
19 com.apple.HIToolbox 0x93d8fa92 DispatchEventToHandlers(EventTargetRec*, OpaqueEventRef*, HandlerCallRec*) + 2013
20 com.apple.HIToolbox 0x93d8ec08 SendEventToEventTargetInternal(OpaqueEventRef*, OpaqueEventTargetRef*, HandlerCallRec*) + 419
21 com.apple.HIToolbox 0x93da0080 SendEventToEventTarget + 34
22 com.apple.HIToolbox 0x93dc5ba2 ToolboxEventDispatcherHandler(OpaqueEventHandlerCallRef*, OpaqueEventRef*, void*) + 2571
23 com.apple.HIToolbox 0x93d8ff68 DispatchEventToHandlers(EventTargetRec*, OpaqueEventRef*, HandlerCallRec*) + 3251
24 com.apple.HIToolbox 0x93d8ec08 SendEventToEventTargetInternal(OpaqueEventRef*, OpaqueEventTargetRef*, HandlerCallRec*) + 419
25 com.apple.HIToolbox 0x93da0080 SendEventToEventTarget + 34
26 com.apple.HIToolbox 0x93f26d14 ToolboxEventDispatcher + 82
27 com.apple.HIToolbox 0x93f3467a GetOrPeekEvent + 521
28 com.apple.HIToolbox 0x93f33fb9 GetNextEventMatchingMask + 463
29 com.apple.HIToolbox 0x93f33bc8 WNEInternal + 198
30 com.apple.HIToolbox 0x93f33af4 WaitNextEvent + 47
31 com.runrev.livecode 0x0016b899 MCScreenDC::handle(double, unsigned char, unsigned char, unsigned char&, unsigned char&) + 1001
32 com.runrev.livecode 0x00167c67 MCScreenDC::wait(double, unsigned char, unsigned char) + 279
33 com.runrev.livecode 0x00095b19 X_main_loop_iteration() + 105
34 com.runrev.livecode 0x000968b1 X_main_loop() + 113
35 com.runrev.livecode 0x00096a32 main + 338
36 com.runrev.livecode 0x00003006 _start + 216
37 com.runrev.livecode 0x00002f2d start + 41
From my admittedly limited knowledge of the inner workings of the LiveCode engine on macOS, this looks like it might be a problem with the 'Carbon' backward compatibility layer in macOS Sierra.
Carbon was the name for the toolbox which allowed developers to write applications in a way very similar to the classic MacOS 9 API instead of completely rewriting them on top of the Cocoa framework.
Apple has declared it 'legacy' technology in MacOS X Snow Leopard 10.6, and deprecated it in OS X Mountain Lion 10.8 <
https://en.wikipedia.org/wiki/Carbon_(API)>
In other words, it is not completely surprising that applications which use this older technology stop working properly a few years later.
And LiveCode version 6.7 was a big effort by the LiveCode team to get rid of Carbon and port the engine to Cocoa.
So you may have better luck by upgrading to a more recent version of LiveCode.
Unfortunately, I'm not sure what I can change in Quartam Reports itself to prevent this particular problem - it was built in pure LiveCode, no externals.
During the next few evenings, I will test LiveCode versions later than 4.6.4 to see if they exhibit the same issue.
Hopefully, I can then advise you of a minimum version to use for a rebuild of your application.
I hope that this helped, even if I don't have a definitive solution for you at this point in time.
Best regards,
Jan Schenkel