Skip to content

Commit

Permalink
Windows: Fixed a focus ping-pong issue in the native file chooser whe…
Browse files Browse the repository at this point in the history
…n using a custom component
  • Loading branch information
ed95 committed Dec 3, 2018
1 parent 6d2e17e commit fdc77e6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions modules/juce_gui_basics/native/juce_win32_FileChooser.cpp
Expand Up @@ -120,6 +120,8 @@ class Win32NativeFileChooser : public ReferenceCountedObject,
EndDialog (hwnd, 0);
}

Component* getCustomComponent() { return customComponent.get(); }

Array<URL> results;

private:
Expand Down Expand Up @@ -567,6 +569,9 @@ class FileChooser::Native : public Component,
if (targetComponent == nullptr)
return false;

if (targetComponent == nativeFileChooser->getCustomComponent())
return true;

return targetComponent->findParentComponentOfClass<FilePreviewComponent>() != nullptr;
}

Expand Down

0 comments on commit fdc77e6

Please sign in to comment.