when switching back from kiosk-mode, on windows, it can happen (not always) that the setKioskComponent method will reentry itself, and delete the kioskModeComponent pointer, while its still used in the first entry of the procedure (look at the callstack)
myApp.exe!juce::Desktop::setKioskModeComponent(juce::Component * componentToUse=0x00000000, bool allowMenusAndBars=true) Line 347 C++ myApp.exe!juce::HWNDComponentPeer::peerWindowProc(HWND__ * h=0x000304a2, unsigned int message=28, unsigned int wParam=0, long lParam=6456) Line 2483 C++ myApp.exe!juce::HWNDComponentPeer::windowProc(HWND__ * h=0x000304a2, unsigned int message=28, unsigned int wParam=0, long lParam=6456) Line 2308 C++ user32.dll!75507694() Unknown [Frames below may be incorrect and/or missing, no symbols loaded for user32.dll] user32.dll!75508baa() Unknown user32.dll!75508aa9() Unknown user32.dll!75508d56() Unknown user32.dll!75508d56() Unknown user32.dll!75508ee9() Unknown ntdll.dll!775add92() Unknown myApp.exe!juce::HWNDComponentPeer::destroyWindowCallback(void * handle=0x00060498) Line 1394 C++ myApp.exe!juce::HWNDComponentPeer::callFunctionIfNotLocked(void * (void *) * callback=0x0129faab, void * userData=0x00060498) Line 2318 C++ myApp.exe!juce::HWNDComponentPeer::~HWNDComponentPeer() Line 592 C++ myApp.exe!juce::HWNDComponentPeer::`scalar deleting destructor'(unsigned int) C++ myApp.exe!juce::ContainerDeletePolicy::destroy(juce::ComponentPeer * object=0x0087ab18) Line 48 C++ myApp.exe!juce::ScopedPointer::~ScopedPointer() Line 100 C++ myApp.exe!juce::Component::addToDesktop(int styleWanted=505, void * nativeWindowToAttachTo=0x00000000) Line 706 C++ myApp.exe!juce::TopLevelWindow::recreateDesktopWindow() Line 262 C++ myApp.exe!juce::TopLevelWindow::setUsingNativeTitleBar(bool shouldUseNativeTitleBar=true) Line 251 C++ myApp.exe!juce::Desktop::setKioskComponent(juce::Component * kioskModeComponent_=0x0087a918, bool enableOrDisable=false, bool __formal=true) Line 3240 C++ myApp.exe!juce::Desktop::setKioskModeComponent(juce::Component * componentToUse=0x00000000, bool allowMenusAndBars=true) Line 366 C++ > myApp.exe!MainWindow::perform(const juce::ApplicationCommandTarget::InvocationInfo & info={...}) Line 1013 C++ myApp.exe!juce::ApplicationCommandTarget::tryToInvoke(const juce::ApplicationCommandTarget::InvocationInfo & info={...}, bool async=false) Line 67 C++ myApp.exe!juce::ApplicationCommandTarget::invoke(const juce::ApplicationCommandTarget::InvocationInfo & info={...}, const bool async=false) Line 145 C++ myApp.exe!juce::ApplicationCommandManager::invoke(const juce::ApplicationCommandTarget::InvocationInfo & inf={...}, bool asynchronously=false) Line 187 C++ myApp.exe!juce::KeyPressMappingSet::invokeCommand(const int commandID=8388640, const juce::KeyPress & key={...}, const bool isKeyDown=true, const int millisecsSinceKeyPressed=0, juce::Component * originatingComponent=0x0087a918) Line 206 C++ myApp.exe!juce::KeyPressMappingSet::keyPressed(const juce::KeyPress & key={...}, juce::Component * originatingComponent=0x0087a918) Line 330 C++ myApp.exe!juce::ComponentPeer::handleKeyPress(int keyCode=65658, unsigned int textCharacter=0) Line 197 C++ myApp.exe!juce::HWNDComponentPeer::doKeyDown(const unsigned int key=122) Line 2024 C++ myApp.exe!juce::HWNDComponentPeer::peerWindowProc(HWND__ * h=0x00060498, unsigned int message=256, unsigned int wParam=122, long lParam=5701633) Line 2429 C++ myApp.exe!juce::HWNDComponentPeer::windowProc(HWND__ * h=0x00060498, unsigned int message=256, unsigned int wParam=122, long lParam=5701633) Line 2308 C++
The crash will happen here, because Desktop::kioskModeComponent is nullptr
First-chance exception at 0x01347B1F in myApp.exe: 0xC0000005: Access violation reading location 0x00000018. Unhandled exception at 0x01347B1F in myApp.exe: 0xC0000005: Access violation reading location 0x00000018. > myApp.exe!juce::Rectangle::getWidth() Line 110 C++ myApp.exe!juce::Component::getWidth() Line 268 C++ myApp.exe!juce::Component::setBounds(int x=558, int y=247, int w=1041, int h=807) Line 1165 C++ myApp.exe!juce::Component::setBounds(const juce::Rectangle & r={...}) Line 1268 C++ myApp.exe!juce::Desktop::setKioskModeComponent(juce::Component * componentToUse=0x00000000, bool allowMenusAndBars=true) Line 371 C++ myApp.exe!MainWindow::perform(const juce::ApplicationCommandTarget::InvocationInfo & info={...}) Line 1013 C++ myApp.exe!juce::ApplicationCommandTarget::tryToInvoke(const juce::ApplicationCommandTarget::InvocationInfo & info={...}, bool async=false) Line 67 C++ myApp.exe!juce::ApplicationCommandTarget::invoke(const juce::ApplicationCommandTarget::InvocationInfo & info={...}, const bool async=false) Line 145 C++ myApp.exe!juce::ApplicationCommandManager::invoke(const juce::ApplicationCommandTarget::InvocationInfo & inf={...}, bool asynchronously=false) Line 187 C++ myApp.exe!juce::KeyPressMappingSet::invokeCommand(const int commandID=8388640, const juce::KeyPress & key={...}, const bool isKeyDown=true, const int millisecsSinceKeyPressed=0, juce::Component * originatingComponent=0x0087a918) Line 206 C++ myApp.exe!juce::KeyPressMappingSet::keyPressed(const juce::KeyPress & key={...}, juce::Component * originatingComponent=0x0087a918) Line 330 C++ myApp.exe!juce::ComponentPeer::handleKeyPress(int keyCode=65658, unsigned int textCharacter=0) Line 197 C++ myApp.exe!juce::HWNDComponentPeer::doKeyDown(const unsigned int key=122) Line 2024 C++ myApp.exe!juce::HWNDComponentPeer::peerWindowProc(HWND__ * h=0x00060498, unsigned int message=256, unsigned int wParam=122, long lParam=5701633) Line 2429 C++ myApp.exe!juce::HWNDComponentPeer::windowProc(HWND__ * h=0x00060498, unsigned int message=256, unsigned int wParam=122, long lParam=5701633) Line 2308 C++
Also i have two other issues with Fullscreen-Mode
On Windows the non-native Menu is missing after switching back, and on Mac the place where the native menus was, isn’t used by the fullscreen window, you see the background picture of the desktop.
(btw the forum page needs to be larger, to view callstacks without line breaks)