2018r4 metal windows title bar colour

Since upgrading from 2018r3 to 2018r4, metal window title bars in MacOS are not respecting the background colour in debug or build. The IDE still shows the correct colour.

Dark mode support set to off for the project.

Have you enabled “Supports Dark Mode” in the “Shared Settings” for your app?

Never mind, I misread your last statement.

Metal windows were deprecated by Apple some time ago.

Probably best to remove the option from Xojo .

Without a metal window, how how to you achieve what I’ve seen called the unified window appearance, like Preview?

That’s a bugger. I’ve always used them as prefer the title bar matching the window colour. Is there an alternative method for achieving this?

A style of NSBorderlessWindowMask will move all buttons into the window itself. Then you could design the upper 22 or so points completely customized.

@Ulrich Bogun Thanks, but NSBorderlessWindowMask is overkill, it does a lot more than just allow a unified look. The metal window used to be perfect. But as of Xojo 2018R4 there is a slight line beneath the title bar. It’s subtle and doesn’t bother me. But a few uses have reported it to me.

BTW, you quoted James Cooksey, not me.

Weird. I just quoted via the quote button, so like now …

Deprecated != removed

I had the same problem after updating to 2018R4 and my bug report was closed with mention: ‘is not a bug’…
There are different possibilities to do this, the simplest is maybe to add a toolbox to the window, but that don’t help in every case. The example below (to add in the Open event) is another possibility to solve this problem:

[code]// To use with macOS SDK 10.10+
try
Const NSWindowStyleMaskFullSizeContentView = 32768 // Bitwise.ShiftLeft(1,15)

Declare Sub setStyleMask Lib “AppKit” Selector “setStyleMask:” (windowRef As Integer, value As Integer)
Declare Function styleMask Lib “AppKit” Selector “styleMask” (windowRef As Integer) As Integer
setStyleMAsk(Me.Handle, styleMask(Self.Handle) + NSWindowStyleMaskFullSizeContentView)

Declare Sub setTitlebarAppearsTransparent Lib “AppKit” Selector “setTitlebarAppearsTransparent:” (windowRef As Integer, value As Boolean)
Declare Sub setTitleVisibility Lib “AppKit” Selector “setTitleVisibility:” (windowRef As Integer, value As Integer)
setTitlebarAppearsTransparent(Self.Handle, True)
setTitleVisibility(Self.Handle,0) //0=Title visible, 1=Title hidden
end try[/code]

The following link shows an example for these three windows WinOSX.zip

1 Like

[quote=427071:@Alain Clausen]I had the same problem after updating to 2018R4 and my bug report was closed with mention: ‘is not a bug’…
There are different possibilities to do this, the simplest is maybe to add a toolbox to the window, but that don’t help in every case. The example below (to add in the Open event) is another possibility to solve this problem:

[code]// To use with macOS SDK 10.10+
try
Const NSWindowStyleMaskFullSizeContentView = 32768 // Bitwise.ShiftLeft(1,15)

Declare Sub setStyleMask Lib “AppKit” Selector “setStyleMask:” (windowRef As Integer, value As Integer)
Declare Function styleMask Lib “AppKit” Selector “styleMask” (windowRef As Integer) As Integer
setStyleMAsk(Me.Handle, styleMask(Self.Handle) + NSWindowStyleMaskFullSizeContentView)

Declare Sub setTitlebarAppearsTransparent Lib “AppKit” Selector “setTitlebarAppearsTransparent:” (windowRef As Integer, value As Boolean)
Declare Sub setTitleVisibility Lib “AppKit” Selector “setTitleVisibility:” (windowRef As Integer, value As Integer)
setTitlebarAppearsTransparent(Self.Handle, True)
setTitleVisibility(Self.Handle,0) //0=Title visible, 1=Title hidden
end try[/code]

The following link shows an example for these three windows WinOSX.zip[/quote]
Alain, that is fantastic, thank you. Works a treat.

A really beautiful workaround which actually gives me more possibilities.

It would make sense that if Metal windows are no longer available, that they be removed from the IDE and not work in the IDE (currently they are an option, display correctly in IDE but do not display at runtime).

I hope we gave more info than that, but if we didn’t…

The change that affected this in 2018r4 was the change in macOS SDK that your apps were compiled against. Up until then, we had been using 10.9 which meant that your apps (and ours) were limited to using older drawing engines. This update means that we are more aligned with what Xcode produces and allows your apps to access more recent technologies.

Yes I know that Greg, and it’s a very good thing to have updated to SDK 10.14, thanks!

The problem here is more the information. No entry is to find about ‘Metal Window’ in the release note, the IDE allows to configure it and the compiler does not complain that this type of window is deprecated but it does not work anymore.
Updating projects using ‘Metal Window’ to 2018R4 changes the visual effect of the windows (only on 10.14) and we don’t know if it’s normal, if it’s a Mojave bug or if it’s a Xojo bug… at the end, everyone loses a lot of time to search why and try to find a workaround.

It’s just my comment but I know it’s not possible to test everything, especially with such a change.

Please don’t remove Metal Window as an option until Apple actually removes it. With it selected and the UI code kindly supplied by Alain Clausen above, I get exactly the look I want, a slightly darker title/toolbar area at the top than one would get if the window was a Document.

Jonathan:
Please consider what happened when Xojo removed the use of g (as Graphics) in Xojo 2018r4, how many people started to complain their code suddenly is no more working…
(that feature was deprecated many years ago and the people who do not take that into account then were complaining when Xojo 2018r4 was released, in cascade…).

Yes, life is not easy.

We don’t remove things before Apple does :slight_smile:

[quote=427106:@Alain Clausen]Yes I know that Greg, and it’s a very good thing to have updated to SDK 10.14, thanks!

The problem here is more the information. No entry is to find about ‘Metal Window’ in the release note, the IDE allows to configure it and the compiler does not complain that this type of window is deprecated but it does not work anymore.
Updating projects using ‘Metal Window’ to 2018R4 changes the visual effect of the windows (only on 10.14) and we don’t know if it’s normal, if it’s a Mojave bug or if it’s a Xojo bug… at the end, everyone loses a lot of time to search why and try to find a workaround.

It’s just my comment but I know it’s not possible to test everything, especially with such a change.[/quote]
The issue is that we are not the ones that deprecated it… it was Apple. It’s not really practical for us to include all of their deprecated items for the last 5 years.