# FileChooserDialogBox and always-on-top-windows

**URL:** <https://forum.juce.com/t/filechooserdialogbox-and-always-on-top-windows/42892>\
**Category:** General JUCE discussion\
**Created:** [November 23, 2020, 5:18pm UTC](https://forum.juce.com/t/filechooserdialogbox-and-always-on-top-windows/42892 "2020-11-23T17:18:04Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![dave96](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/dave96/32/8487_2.png) [@dave96](https://forum.juce.com/u/dave96)\
**Post date:** [November 23, 2020, 5:18pm UTC](https://forum.juce.com/t/filechooserdialogbox-and-always-on-top-windows/42892/1 "2020-11-23T17:18:04Z")

</div>

I’m having a bit of a problem with showing file choosers from windows that are always on top. We have a lot of these windows as you’d expect plugin windows to behave on top of the main UI.

However, when we launch a file chooser dialog from a `FileChooser`, it will appear behind the plugin windows. I think this change in the FileChooserDialogBox constructor would make sense here to make it always on top if other windows are always on top?

```auto
    if (parentComp != nullptr)
        parentComp->addAndMakeVisible (this);
    else if (juce_areThereAnyAlwaysOnTopWindows())
        setAlwaysOnTop (true);

```

---

<div class="post-metadata">

**Author:** ![rory](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/rory/32/534_2.png) [@rory](https://forum.juce.com/u/rory)\
**Post date:** [November 23, 2020, 7:40pm UTC](https://forum.juce.com/t/filechooserdialogbox-and-always-on-top-windows/42892/2 "2020-11-23T19:40:36Z")

</div>

I’ve been having the same problems of late…

> [@FileBasedDocument saveAsInteractive() problem/bug](https://forum.juce.com/t/filebaseddocument-saveasinteractive-problem-bug/42641):
>
> Whenever I try to save a file that already exists, the warning window appears behind the FileChooser component. With no way to access it the warning window, I have to manually kill my program. Is there are workaround?

---

<div class="post-metadata">

**Author:** ![dave96](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/dave96/32/8487_2.png) [@dave96](https://forum.juce.com/u/dave96)\
**Post date:** [November 23, 2020, 10:54pm UTC](https://forum.juce.com/t/filechooserdialogbox-and-always-on-top-windows/42892/3 "2020-11-23T22:54:03Z")

</div>

Is this with the native file browser or juce one?  
What is the dialog? Is it an AlertWindow? I thought they were forced to be always on top if there were other on-top Components like in my suggestion…

---

<div class="post-metadata">

**Author:** ![rory](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/rory/32/534_2.png) [@rory](https://forum.juce.com/u/rory)\
**Post date:** [November 24, 2020, 9:13am UTC](https://forum.juce.com/t/filechooserdialogbox-and-always-on-top-windows/42892/4 "2020-11-24T09:13:18Z")

</div>

It’s a native dialogue. And it’s an AlertWindow. The FileBasedDocument manages the FileChooser in this case. It’s kind of frustrating. I will prepare a short demo once I get a chance.

---

<div class="post-metadata">

**Author:** ![dave96](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/dave96/32/8487_2.png) [@dave96](https://forum.juce.com/u/dave96)\
**Post date:** [January 21, 2021, 11:10am UTC](https://forum.juce.com/t/filechooserdialogbox-and-always-on-top-windows/42892/5 "2021-01-21T11:10:33Z")

</div>

Apologies for the bump, I don’t normally like to do this but I was going through my bug tracker and was reminded this is still open.

---

<div class="post-metadata">

**Author:** ![reuk](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/reuk/32/21494_2.png) [@reuk](https://forum.juce.com/u/reuk)\
**Post date:** [January 22, 2021, 12:20pm UTC](https://forum.juce.com/t/filechooserdialogbox-and-always-on-top-windows/42892/6 "2021-01-22T12:20:49Z")

</div>

Thanks, I’ve added the patch here:

> <https://github.com/juce-framework/JUCE/commit/f647c54b749c8fdc40cf7296ff68dc25391a6926>

---

<div class="post-metadata">

**Author:** ![dave96](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/dave96/32/8487_2.png) [@dave96](https://forum.juce.com/u/dave96)\
**Post date:** [January 22, 2021, 12:22pm UTC](https://forum.juce.com/t/filechooserdialogbox-and-always-on-top-windows/42892/7 "2021-01-22T12:22:52Z")

</div>

Perfect. Thanks! 👍
