No title bar..

Ok, thanks. I realized that it’s just Windows vs. Mac.

I have found that it’s best to do a position check in the "Activate’ event of the window. There are numerous circumstances as to why your window may be moved for you.

This way if your window does get moved under the menubar by some OS level function, simply clicking on the window will bring it back into a position where the user can grab the titlebar.

I honestly have no idea how Apple let this happen, they know the window has a titlebar, they know the user can only move the window by the titlebar, yet their OS can sometimes automatically move your window to a position where the user can’t get at it’s titlebar. Frustrating as heck that things like this still exist.

[quote=466889:@Sam Rowlands]I have found that it’s best to do a position check in the "Activate’ event of the window. There are numerous circumstances as to why your window may be moved for you.

This way if your window does get moved under the menubar by some OS level function, simply clicking on the window will bring it back into a position where the user can grab the titlebar.[/quote]
Great tip Sam, thank you. I should do this too!

[quote=466871:@Scott Cadillac]I’ve seen macOS do that for Finder windows, but I never knew it did that for other applications. If it does, it sure does a poor job of it.

So maybe in Enric’s case, that information got corrupted and not his project?

@Enric Herrera, if you move a copy of your project to another Mac (or even a Windows computer), does it still do the same thing?[/quote]
I tested in another Mac and then it not happens (the window is opened normal)

[quote=466878:@Paul Lefebvre]Could there be a corrupt preference for your app in ~/Library/Preferences/? Look for the bundle ID as a plist in that folder.

You might also try creating a new user account and trying from there.[/quote]
With another account in the same computer it looks ok, so it’s, probably a corruption on a system file. but no idea which one.

To find the problem system file, you need your bundle ID which is under Build Settings > macOS in the Xojo IDE, like the following screen-shot:

In my screen-shot example, I think from what @Paul Lefebvre is saying, the potentially corrupt file would be found under:
/Users/scott/Library/Preferences/fyi.basic.imagedpi.plist (which does exist on my Mac).

In your case Enric, change my example path with your home folder name, e.g., enric(?) and my bundle ID with what you have (add the .plist extension).

Note: if you can’t find your Library folder in your Home folder, try one of these steps

Also, if you can’t find the file, just try changing the Bundle ID to something different (and unique) and do a fresh Build or Run.

I hope that helps.

Thanks Scott I already have deleted the com.enric.nlb.plist but with no effects for now.
I was just changing the bundle and make a save as and see whats happens

Changing the bundle id has no effects.

From the DOCS

aWindow.Top = newIntegerValue
or
IntegerValue = aWindow.Top

Supported for all project types and targets.
The distance (in pixels) between the top edge of the screen and the top edge of the content region of the window.
Notes

The Top value refers to the topmost part of the window content region, which is the area starting below the Window Title Bar.
Setting Top = 0 moves the top of the windows content area to the top of the screen. On macOS, this puts the window behind the main menu bar that appears at the top of the screen. To position a window directly below the main menu bar, you should use Screen.AvailableTop to get the topmost position after the menu bar and then use Window.Bounds to position the window.

I tried this in the Activate event handler:

Me.Left = 50
Me.Top = Screen(0).AvailableTop + 50

Seems to work ok for me.

Hi Philip, now I’m just using, in the Activate event handler:

me.Top=  45

But the default window should not need this code to open with the title bar visible, something is wrong in that window.

I found the issue about main window opens hiding the title bar. It happens in these situations:
My monitor display 1920 x 1080
The window is 990 Height
My dock bar is botton, always on

Turning hiding on the preferences dock, then the window opens ok.
So if:
window height + screen(0).top + dock.height > monitor.resolution.height then the window opens hiding the title bar.
Is it an Apple issue?, a Xojo one? or …

More in the same if you run

[quote]Var s As String = “Height=” + Str(Screen.ScreenAt(0).AvailableHeight) + EndOfLine
MessageBox(s)[/quote]

I get the available height (in pixels) of the specified screen taking into account the menubar and dock.
In my case I get 1010, the window is 990 height so, why it opens behind menu bar?

I’d say it’s an Apple bug.

Since I installed 10.14, I sometimes see a window jump around when I start to resize it. It’s like it gets confused for a moment as to which co-ordinate system it should be using (top-down or bottom-up).

To be honest, I’m not surprised, most of Apple’s API is bottom-up (eurgh), but there are things which are top-down (yah) and this causes me headaches.

I would also suggest that you reconsider the design of your window. If you can, make it so that the content can be scrolled and the default height is shorter, a lot shorter.

Because you need the actual window height, IRC that’s only the height of the content. There’s the window chrome, which depending on toolbar or not, can vary in size.

Use this instead.
https://documentation.xojo.com/api/deprecated/window.html#window-bounds

DisplayPostscript was (is still ?) used to display stuff by Apple on screens.

On Postscript, 0,0 is located at Bottom/Left.

Of course, if nothing changed lately