Discussion:
[platform-swt-dev] macOS 10.14 (mojave)
Thomas Singer
2018-09-10 09:29:01 UTC
Permalink
Hi all,

Does anybody already had a chance to try an SWT application on the macOS
Mojave preview, especially the dark mode? I've received screenshots from
a user of SmartGit and it shows light controls and even a light (system)
toolbar. Could it be that there are some changes required on the
SWT/native part to make use of the dark mode?
--
Best regards,
Thomas Singer
=============
syntevo GmbH
https://www.syntevo.com
https://www.syntevo.com/blog
Jacob
2018-09-10 15:48:36 UTC
Permalink
For native Cocoa applications they need to be linked against the 10.14 SDK to enable dark mode. How that would work with Java and SWT I don’t know, perhaps link the native dynamic libraries with the new SDK. It is possible to manually handle this if relinking with 10.14 SDK is not enough.

The reason for this is not default is to avoid breaking existing applications. There are applications with hard coded colors which need to be updated to look good with the dark mode. The SDK provides dynamic colors which will change depending on the mode that is used. SWT might need to be updated as well.

There are several good videos from this year’s WWDC which covers dark mode and how to enable that for applications.

https://developer.apple.com/videos/play/wwdc2018/210/
https://developer.apple.com/videos/play/wwdc2018/218/

—
/Jacob Carlborg
Post by Thomas Singer
Hi all,
Does anybody already had a chance to try an SWT application on the macOS Mojave preview, especially the dark mode? I've received screenshots from a user of SmartGit and it shows light controls and even a light (system) toolbar. Could it be that there are some changes required on the SWT/native part to make use of the dark mode?
--
Best regards,
Thomas Singer
=============
syntevo GmbH
https://www.syntevo.com
https://www.syntevo.com/blog
_______________________________________________
platform-swt-dev mailing list
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/platform-swt-dev
Thomas Singer
2018-09-10 16:37:33 UTC
Permalink
Hi Jacob,

Thank you very much for the answer. So I understand that SWT (or any
other hard-linked application) can't support macOS 10.14 and macOS
<10.14 at the same time?
--
Best regards,
Thomas Singer
For native Cocoa applications they need to be linked against the 10.14 SDK to enable dark mode. How that would work with Java and SWT I don’t know, perhaps link the native dynamic libraries with the new SDK. It is possible to manually handle this if relinking with 10.14 SDK is not enough.
The reason for this is not default is to avoid breaking existing applications. There are applications with hard coded colors which need to be updated to look good with the dark mode. The SDK provides dynamic colors which will change depending on the mode that is used. SWT might need to be updated as well.
There are several good videos from this year’s WWDC which covers dark mode and how to enable that for applications.
https://developer.apple.com/videos/play/wwdc2018/210/
https://developer.apple.com/videos/play/wwdc2018/218/

/Jacob Carlborg
Post by Thomas Singer
Hi all,
Does anybody already had a chance to try an SWT application on the macOS Mojave preview, especially the dark mode? I've received screenshots from a user of SmartGit and it shows light controls and even a light (system) toolbar. Could it be that there are some changes required on the SWT/native part to make use of the dark mode?
--
Best regards,
Thomas Singer
=============
syntevo GmbH
https://www.syntevo.com
https://www.syntevo.com/blog
_______________________________________________
platform-swt-dev mailing list
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/platform-swt-dev
_______________________________________________
platform-swt-dev mailing list
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/platform-swt-dev
Till Brychcy
2018-09-10 16:55:48 UTC
Permalink
I’ve tried some time ago with an earlier beta installed on an external hard drive.

As documented in https://developer.apple.com/documentation/appkit/nsappearancecustomization/choosing_a_specific_appearance_for_your_app you don’t have to link against the 10.14 macOS SDK, but can also simply set the NSRequiresAquaSystemAppearance property to false in the Info.plist

I did that and the window titles etc. were dark, but I got some crashes in swt (I think NPEs) and the application was unusable.

I don’t know if this was caused by bugs in that beta version or if the behaviour of some APIs have changed in a documented way if this is set.

(I think when I tried, there was no API-update document available, maybe it is by now - haven’t checked since then)
Post by Thomas Singer
Hi Jacob,
Thank you very much for the answer. So I understand that SWT (or any other hard-linked application) can't support macOS 10.14 and macOS <10.14 at the same time?
--
Best regards,
Thomas Singer
For native Cocoa applications they need to be linked against the 10.14 SDK to enable dark mode. How that would work with Java and SWT I don’t know, perhaps link the native dynamic libraries with the new SDK. It is possible to manually handle this if relinking with 10.14 SDK is not enough.
The reason for this is not default is to avoid breaking existing applications. There are applications with hard coded colors which need to be updated to look good with the dark mode. The SDK provides dynamic colors which will change depending on the mode that is used. SWT might need to be updated as well.
There are several good videos from this year’s WWDC which covers dark mode and how to enable that for applications.
https://developer.apple.com/videos/play/wwdc2018/210/
https://developer.apple.com/videos/play/wwdc2018/218/

/Jacob Carlborg
Post by Thomas Singer
Hi all,
Does anybody already had a chance to try an SWT application on the macOS Mojave preview, especially the dark mode? I've received screenshots from a user of SmartGit and it shows light controls and even a light (system) toolbar. Could it be that there are some changes required on the SWT/native part to make use of the dark mode?
--
Best regards,
Thomas Singer
=============
syntevo GmbH
https://www.syntevo.com
https://www.syntevo.com/blog
_______________________________________________
platform-swt-dev mailing list
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/platform-swt-dev
_______________________________________________
platform-swt-dev mailing list
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/platform-swt-dev
_______________________________________________
platform-swt-dev mailing list
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/platform-swt-dev
Jacob
2018-09-10 19:14:19 UTC
Permalink
I just give it a try with NSRequiresAquaSystemAppearance on Eclipse (the Scala IDE) and it worked, it didn’t crash for the few things I tried. Since Eclipse uses quite a few custom controls, like the tab bar and toolbar very few controls had the dark mode colors. I provided a screen shot in my other email.
--
/Jacob Carlborg
I’ve tried some time ago with an earlier beta installed on an external hard drive.
As documented in https://developer.apple.com/documentation/appkit/nsappearancecustomization/choosing_a_specific_appearance_for_your_app you don’t have to link against the 10.14 macOS SDK, but can also simply set the NSRequiresAquaSystemAppearance property to false in the Info.plist
I did that and the window titles etc. were dark, but I got some crashes in swt (I think NPEs) and the application was unusable.
I don’t know if this was caused by bugs in that beta version or if the behaviour of some APIs have changed in a documented way if this is set.
(I think when I tried, there was no API-update document available, maybe it is by now - haven’t checked since then)
Post by Thomas Singer
Hi Jacob,
Thank you very much for the answer. So I understand that SWT (or any other hard-linked application) can't support macOS 10.14 and macOS <10.14 at the same time?
--
Best regards,
Thomas Singer
Post by Jacob
For native Cocoa applications they need to be linked against the 10.14 SDK to enable dark mode. How that would work with Java and SWT I don’t know, perhaps link the native dynamic libraries with the new SDK. It is possible to manually handle this if relinking with 10.14 SDK is not enough.
The reason for this is not default is to avoid breaking existing applications. There are applications with hard coded colors which need to be updated to look good with the dark mode. The SDK provides dynamic colors which will change depending on the mode that is used. SWT might need to be updated as well.
There are several good videos from this year’s WWDC which covers dark mode and how to enable that for applications.
https://developer.apple.com/videos/play/wwdc2018/210/
https://developer.apple.com/videos/play/wwdc2018/218/
—
/Jacob Carlborg
Post by Thomas Singer
Hi all,
Does anybody already had a chance to try an SWT application on the macOS Mojave preview, especially the dark mode? I've received screenshots from a user of SmartGit and it shows light controls and even a light (system) toolbar. Could it be that there are some changes required on the SWT/native part to make use of the dark mode?
--
Best regards,
Thomas Singer
=============
syntevo GmbH
https://www.syntevo.com
https://www.syntevo.com/blog
_______________________________________________
platform-swt-dev mailing list
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/platform-swt-dev
_______________________________________________
platform-swt-dev mailing list
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/platform-swt-dev
_______________________________________________
platform-swt-dev mailing list
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/platform-swt-dev
_______________________________________________
platform-swt-dev mailing list
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/platform-swt-dev
Lakshmi P Shanmugam
2018-09-12 11:21:07 UTC
Permalink
Thanks Jacob & Till for trying out Eclipse on macOS 10.14 beta.
I've created a top level bug to capture issues related to macOS 10.14
support - Bug 538976: Support macOS 10.14 (Mojave)
<https://bugs.eclipse.org/bugs/show_bug.cgi?id=538976>

Regards,
Lakshmi
Post by Jacob
I just give it a try with NSRequiresAquaSystemAppearance on Eclipse (the
Scala IDE) and it worked, it didn’t crash for the few things I tried. Since
Eclipse uses quite a few custom controls, like the tab bar and toolbar very
few controls had the dark mode colors. I provided a screen shot in my other
email.
--
/Jacob Carlborg
I’ve tried some time ago with an earlier beta installed on an external hard drive.
As documented in
https://developer.apple.com/documentation/appkit/nsappearancecustomization/choosing_a_specific_appearance_for_your_app
you don’t have to link against the 10.14 macOS SDK, but can also simply set
the NSRequiresAquaSystemAppearance property to false in the Info.plist
I did that and the window titles etc. were dark, but I got some crashes
in swt (I think NPEs) and the application was unusable.
I don’t know if this was caused by bugs in that beta version or if the
behaviour of some APIs have changed in a documented way if this is set.
(I think when I tried, there was no API-update document available, maybe
it is by now - haven’t checked since then)
Hi Jacob,
Thank you very much for the answer. So I understand that SWT (or any other
hard-linked application) can't support macOS 10.14 and macOS <10.14 at the
same time?
--
Best regards,
Thomas Singer
For native Cocoa applications they need to be linked against the 10.14 SDK
to enable dark mode. How that would work with Java and SWT I don’t know,
perhaps link the native dynamic libraries with the new SDK. It is possible
to manually handle this if relinking with 10.14 SDK is not enough.
The reason for this is not default is to avoid breaking existing
applications. There are applications with hard coded colors which need to
be updated to look good with the dark mode. The SDK provides dynamic colors
which will change depending on the mode that is used. SWT might need to be
updated as well.
There are several good videos from this year’s WWDC which covers dark mode
and how to enable that for applications.
https://developer.apple.com/videos/play/wwdc2018/210/
https://developer.apple.com/videos/play/wwdc2018/218/
—
/Jacob Carlborg
Hi all,
Does anybody already had a chance to try an SWT application on the macOS
Mojave preview, especially the dark mode? I've received screenshots from a
user of SmartGit and it shows light controls and even a light (system)
toolbar. Could it be that there are some changes required on the SWT/native
part to make use of the dark mode?
--
Best regards,
Thomas Singer
=============
syntevo GmbH
https://www.syntevo.com
https://www.syntevo.com/blog
_______________________________________________
platform-swt-dev mailing list
To change your delivery options, retrieve your password, or unsubscribe
from this list, visit
https://dev.eclipse.org/mailman/listinfo/platform-swt-dev
_______________________________________________
platform-swt-dev mailing list
To change your delivery options, retrieve your password, or unsubscribe
from this list, visit
https://dev.eclipse.org/mailman/listinfo/platform-swt-dev
_______________________________________________
platform-swt-dev mailing list
To change your delivery options, retrieve your password, or unsubscribe
from this list, visit
https://dev.eclipse.org/mailman/listinfo/platform-swt-dev
_______________________________________________
platform-swt-dev mailing list
To change your delivery options, retrieve your password, or unsubscribe
from this list, visit
https://dev.eclipse.org/mailman/listinfo/platform-swt-dev
_______________________________________________
platform-swt-dev mailing list
To change your delivery options, retrieve your password, or unsubscribe
from this list, visit
https://dev.eclipse.org/mailman/listinfo/platform-swt-dev
--
*Regards,Lakshmi P Shanmugam*
Thomas Singer
2018-09-28 15:40:12 UTC
Permalink
Does anybody have an idea, why our application SmartGit looks so bright
on macOS 10.14 but not on earlier versions? Has the shell or panel
default color changed from gray to white? Does it depend on some
Info.plist option (it looks the same, no matter whether setting
NSRequiresAquaSystemAppearance to true or false). Thanks in advance.
--
Best regards,
Thomas Singer
=============
syntevo GmbH
https://www.syntevo.com
https://www.syntevo.com/blog
I’ve tried some time ago with an earlier beta installed on an external hard drive.
As documented in https://developer.apple.com/documentation/appkit/nsappearancecustomization/choosing_a_specific_appearance_for_your_app you don’t have to link against the 10.14 macOS SDK, but can also simply set the NSRequiresAquaSystemAppearance property to false in the Info.plist
I did that and the window titles etc. were dark, but I got some crashes in swt (I think NPEs) and the application was unusable.
I don’t know if this was caused by bugs in that beta version or if the behaviour of some APIs have changed in a documented way if this is set.
(I think when I tried, there was no API-update document available, maybe it is by now - haven’t checked since then)
Post by Thomas Singer
Hi Jacob,
Thank you very much for the answer. So I understand that SWT (or any other hard-linked application) can't support macOS 10.14 and macOS <10.14 at the same time?
--
Best regards,
Thomas Singer
Post by Jacob
For native Cocoa applications they need to be linked against the 10.14 SDK to enable dark mode. How that would work with Java and SWT I don’t know, perhaps link the native dynamic libraries with the new SDK. It is possible to manually handle this if relinking with 10.14 SDK is not enough.
The reason for this is not default is to avoid breaking existing applications. There are applications with hard coded colors which need to be updated to look good with the dark mode. The SDK provides dynamic colors which will change depending on the mode that is used. SWT might need to be updated as well.
There are several good videos from this year’s WWDC which covers dark mode and how to enable that for applications.
https://developer.apple.com/videos/play/wwdc2018/210/
https://developer.apple.com/videos/play/wwdc2018/218/
—
/Jacob Carlborg
Post by Thomas Singer
Hi all,
Does anybody already had a chance to try an SWT application on the macOS Mojave preview, especially the dark mode? I've received screenshots from a user of SmartGit and it shows light controls and even a light (system) toolbar. Could it be that there are some changes required on the SWT/native part to make use of the dark mode?
--
Best regards,
Thomas Singer
=============
syntevo GmbH
https://www.syntevo.com
https://www.syntevo.com/blog
_______________________________________________
platform-swt-dev mailing list
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/platform-swt-dev
_______________________________________________
platform-swt-dev mailing list
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/platform-swt-dev
_______________________________________________
platform-swt-dev mailing list
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/platform-swt-dev
_______________________________________________
platform-swt-dev mailing list
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/platform-swt-dev
Jacob *
2018-09-28 15:43:18 UTC
Permalink
Does anybody have an idea, why our application SmartGit looks so bright on macOS 10.14 but not on earlier versions? Has the shell or panel default color changed from gray to white? Does it depend on some Info.plist option (it looks the same, no matter whether setting NSRequiresAquaSystemAppearance to true or false). Thanks in advance.
No, it should not be white like that. That’s a bug, either in SmartGit, SWT or in macOS.

--
/Jacob Carlborg

Jacob
2018-09-10 19:12:07 UTC
Permalink
No no, you can definitely support both macOS 10.14 and older versions in the same application. It’s possible to specify the minimum deployment target when building an application. If you need to use features of a newer version of macOS than the minimum deployment target you need to guard those usages with an if statement. Swift and Objective-C has language support for this, but how it’s actually working is that most symbols in the SDK have weak linkage, that means that the symbols don’t need to be present at runtime. Then you need to check if the symbols are available at runtime before using a feature requiring the new symbol.

In Swift it would look something like:

@available(macOS 10.14, *)
func fooBar()

And the usage:

if #available(macOS 10.14, *) {
fooBar()
// 10.14 specific code
} else {
// fallback for older versions
}

Doing that manually in C would be something like:

void fooBar() __attribute__ ((weak_import));

if (fooBar) {
fooBar(); // foo is available
} else {
// fallback for older versions
}

With Java I’m guessing the native dynamic libraries are loaded with the a method similar to “dlopen” and symbols loaded using “dlsym”. In that case the same approach as described above should be possible to use.

I’ve attached a screen shot of the Scala IDE (based on Eclipse which uses SWT, using the NSRequiresAquaSystemAppearance method) when dark mode is enabled. This shows that some parts are correctly using the dark mode colors (like the background color in the side bar and the two bottom views). At the same time it’s possible to see that the text color looks hard coded in the side bar (it would otherwise be white). Also, since Eclipse uses quite a few of the custom controls (like the tab bar and tool bar) that SWT provides, very few parts of the application has the correct colors. SWT needs to use the dynamic colors, that will change depending on if dark mode or light mode is enabled, and not hard coded RGB values. This will also give the correct values for the high contrast versions (an accessibility feature) that are available as well.

In the 10.14 SDK there are quite a few new semantic colors (as they are called) which instead of specifying a color like white or blue specifies what it should be used for, i.e. label color, tab background color and so on. These colors are dynamic and change according to the selected mode. Also standard colors like red, blue, green and so on are available as dynamic colors that change slightly between dark and light mode.

macOS 10.14 also added a new feature making it possible for the users to select the accent color (i.e. usually the color of the “Ok” button in a dialog). This needs to be handled as well.
--
/Jacob Carlborg
Post by Thomas Singer
Hi Jacob,
Thank you very much for the answer. So I understand that SWT (or any other hard-linked application) can't support macOS 10.14 and macOS <10.14 at the same time?
--
Best regards,
Thomas Singer
Post by Jacob
For native Cocoa applications they need to be linked against the 10.14 SDK to enable dark mode. How that would work with Java and SWT I don’t know, perhaps link the native dynamic libraries with the new SDK. It is possible to manually handle this if relinking with 10.14 SDK is not enough.
The reason for this is not default is to avoid breaking existing applications. There are applications with hard coded colors which need to be updated to look good with the dark mode. The SDK provides dynamic colors which will change depending on the mode that is used. SWT might need to be updated as well.
There are several good videos from this year’s WWDC which covers dark mode and how to enable that for applications.
https://developer.apple.com/videos/play/wwdc2018/210/
https://developer.apple.com/videos/play/wwdc2018/218/
—
/Jacob Carlborg
Post by Thomas Singer
Hi all,
Does anybody already had a chance to try an SWT application on the macOS Mojave preview, especially the dark mode? I've received screenshots from a user of SmartGit and it shows light controls and even a light (system) toolbar. Could it be that there are some changes required on the SWT/native part to make use of the dark mode?
--
Best regards,
Thomas Singer
=============
syntevo GmbH
https://www.syntevo.com
https://www.syntevo.com/blog
_______________________________________________
platform-swt-dev mailing list
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/platform-swt-dev
_______________________________________________
platform-swt-dev mailing list
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/platform-swt-dev
_______________________________________________
platform-swt-dev mailing list
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/platform-swt-dev
Loading...