# DocumentWindow: title bar not visible

**URL:** <https://forum.juce.com/t/documentwindow-title-bar-not-visible/55091>\
**Category:** Windows\
**Created:** [February 23, 2023, 12:09pm UTC](https://forum.juce.com/t/documentwindow-title-bar-not-visible/55091 "2023-02-23T12:09:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![MBO](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/mbo/32/5045_2.png) [@MBO](https://forum.juce.com/u/MBO)\
**Post date:** [February 23, 2023, 12:09pm UTC](https://forum.juce.com/t/documentwindow-title-bar-not-visible/55091/1 "2023-02-23T12:09:26Z")

</div>

I’ve got a case as follows on Windows:

- I create a new `DocumentWindow` and add it to `Desktop`
- I call:

`documentWindow->setBounds (Desktop::getInstance().getDisplays().getPrimaryDisplay()->userArea);`

The widow fills the screen, but no title bar is visible.

- When I call:

`documentWindow->setBounds (Desktop::getInstance().getDisplays().getPrimaryDisplay()->userArea.reduced(50);`

then the title bar is visible.

This is with `setUsingNativeTitleBar (true)`

On Mac it works correctly. Basically, I want to have my document window open with the title bar already visible no matter what size of the window is. It looks like `getLocalBounds()` called on `DocumentWindow` sometimes includes area of the title bar, so the whole window area is repainted / covered by a content component. Or maybe I am missing something?

---

<div class="post-metadata">

**Author:** ![ImJimmi](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/imjimmi/32/10843_2.png) [@ImJimmi](https://forum.juce.com/u/ImJimmi)\
**Post date:** [February 23, 2023, 1:35pm UTC](https://forum.juce.com/t/documentwindow-title-bar-not-visible/55091/2 "2023-02-23T13:35:58Z")

</div>

Have you looked at

[https://docs.juce.com/master/classResizableWindow.html#a11960e524b3e9046b92d4f9f6e0dac6c](https://docs.juce.com/master/classResizableWindow.html#a11960e524b3e9046b92d4f9f6e0dac6c)

[https://docs.juce.com/master/classResizableWindow.html#a44f7200f6fe97b06be121ce5d439058d](https://docs.juce.com/master/classResizableWindow.html#a44f7200f6fe97b06be121ce5d439058d)

or

[https://docs.juce.com/master/classDocumentWindow.html#a12c38c5653adf804886d67ec22aee4e0](https://docs.juce.com/master/classDocumentWindow.html#a12c38c5653adf804886d67ec22aee4e0)

Off the top of my head I can’t remember if those work with native windows, but worth a shot to see if anything works?

---

<div class="post-metadata">

**Author:** ![MBO](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/mbo/32/5045_2.png) [@MBO](https://forum.juce.com/u/MBO)\
**Post date:** [February 23, 2023, 3:58pm UTC](https://forum.juce.com/t/documentwindow-title-bar-not-visible/55091/3 "2023-02-23T15:58:10Z")

</div>

Thanks, yes, I played with these settings, but it even if I remove my content component and create an empty window with size = userArea, then the title bar is not shown.

But if I write  
`documentWindow->setBounds (Desktop::getInstance().getDisplays().getPrimaryDisplay()->userArea.withTrimmedTop (1));`

or even:

`documentWindow->setBounds (Desktop::getInstance().getDisplays().getPrimaryDisplay()->userArea.expanded (1));`

then the title bar is visible. Trimming width, height etc. does not help too, so the conclusion is that the title bar is not drawn (or rather is painted over with a background colour / content component) always when the document window position is (0, 0).

Edit. I think the above statements are not exactly right. When I run this simple code:

```auto
            DocumentWindow* dw = new DocumentWindow ("TEST", Colours::white, 7, true);
            dw->setUsingNativeTitleBar (true);
            dw->setBounds (0, 15, 600, 400);
            dw->setVisible (true);

```

The window appears but with the title bar cut, so Desktop’s y = 0 seems not to be zero? I’m a little bit lost here.
