Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Display.java12
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Shell.java4
2 files changed, 11 insertions, 5 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Display.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Display.java
index 43425e09de..9e3399c907 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Display.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Display.java
@@ -4270,6 +4270,16 @@ NSAppearance getAppearance (APPEARANCE newMode) {
return NSAppearance.appearanceNamed (NSString.stringWith (appearanceName));
}
+void setAppAppearance (APPEARANCE newMode) {
+ if (OS.VERSION_MMB < OS.VERSION_MMB (10, 14, 0)) return;
+
+ NSAppearance appearance = getAppearance(newMode);
+ if (appearance != null && application != null) {
+ OS.objc_msgSend(application.id, OS.sel_setAppearance_, appearance.id);
+ appAppearance = newMode;
+ }
+}
+
void setWindowAppearance (NSWindow window, NSAppearance appearance) {
if (window != null && appearance != null) {
OS.objc_msgSend(window.id, OS.sel_setAppearance_, appearance.id);
@@ -5534,7 +5544,7 @@ static long /*int*/ applicationProc(long /*int*/ id, long /*int*/ sel, long /*in
NSApplication application = display.application;
if (sel == OS.sel_appAppearanceChanged) {
- display.setWindowsAppearance(arg0 == 1 ? APPEARANCE.Dark : APPEARANCE.Light);
+ display.setAppAppearance(arg0 == 1 ? APPEARANCE.Dark : APPEARANCE.Light);
return 0;
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Shell.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Shell.java
index 183fd78c0d..5afb2706ec 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Shell.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Shell.java
@@ -760,10 +760,6 @@ void createHandle () {
style |= SWT.NO_BACKGROUND;
}
- if (display.appAppearance != null) {
- display.setWindowAppearance(window, display.getAppearance(display.appAppearance));
- }
-
windowDelegate = (SWTWindowDelegate)new SWTWindowDelegate().alloc().init();
if (window == null) {

Back to the top