diff options
author | Silenio Quarti <silenio> | 2009-09-24 15:54:49 +0000 |
---|---|---|
committer | Silenio Quarti <silenio> | 2009-09-24 15:54:49 +0000 |
commit | 404220ebbba0b3f4848500fd6e74d3e252f3eaee (patch) | |
tree | f51e502111cfb29ece00057d9c152a44dc293f4a | |
parent | fe058a0d2f3319370c7582e224ebb15343d45b88 (diff) | |
download | eclipse.platform.swt-404220ebbba0b3f4848500fd6e74d3e252f3eaee.tar.gz eclipse.platform.swt-404220ebbba0b3f4848500fd6e74d3e252f3eaee.tar.xz eclipse.platform.swt-404220ebbba0b3f4848500fd6e74d3e252f3eaee.zip |
290320 - SWT overrides LSUIPresentationMode in Info.plist
4 files changed, 23 insertions, 8 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Display.java b/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Display.java index 2c880b2de6..9c0cead59f 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Display.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Display.java @@ -218,6 +218,7 @@ public class Display extends Device { /* Dock icon */ int dockImage; + int systemUIMode, systemUIOptions; /* Key Mappings. */ static int [] [] KeyTable = { @@ -1049,6 +1050,11 @@ void createDisplay (DeviceData data) { runLoop = OS.GetCFRunLoopFromEventLoop (OS.GetCurrentEventLoop ()); OS.TXNInitTextension (0, 0, 0); + int[] bufferMode = new int[1], bufferOptions = new int[1]; + OS.GetSystemUIMode(bufferMode, bufferOptions); + systemUIMode = bufferMode[0]; + systemUIOptions = bufferOptions[0]; + /* Save the current highlight color */ OS.RegisterAppearanceClient (); highlightColor = new RGBColor (); diff --git a/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Shell.java b/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Shell.java index e81ceaa735..b449a15542 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Shell.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Shell.java @@ -2023,15 +2023,17 @@ void updateSystemUIMode () { current = (Shell) current.parent; } if (!isActive) return; + int mode = display.systemUIMode, options = display.systemUIOptions; if (fullScreen) { - int mode = OS.kUIModeAllHidden; + mode = OS.kUIModeAllHidden; if (menuBar != null) { mode = OS.kUIModeContentHidden; } - OS.SetSystemUIMode (mode, 0); - } else { - OS.SetSystemUIMode (OS.kUIModeNormal, 0); + options = 0; } + int[] uiMode = new int[1], uiOptions = new int[1]; + OS.GetSystemUIMode(uiMode, uiOptions); + if (uiMode[0] != mode || uiOptions[0] != options) OS.SetSystemUIMode (mode, options); } } 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 2ad4cdf58f..ebad5a2d05 100755 --- 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 @@ -140,6 +140,7 @@ public class Display extends Device { NSImage dockImage; boolean isEmbedded; static boolean launched = false; + int systemUIMode, systemUIOptions; /* Focus */ Control focusControl, currentFocusControl; @@ -843,6 +844,11 @@ void createDisplay (DeviceData data) { application.setDelegate(applicationDelegate); } } + + int[] bufferMode = new int[1], bufferOptions = new int[1]; + OS.GetSystemUIMode(bufferMode, bufferOptions); + systemUIMode = bufferMode[0]; + systemUIOptions = bufferOptions[0]; } void createMainMenu () { 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 57578ea336..f63e27f74e 100755 --- 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 @@ -1792,16 +1792,17 @@ void updateParent (boolean visible) { void updateSystemUIMode () { if (!getMonitor ().equals (display.getPrimaryMonitor ())) return; - int mode = OS.kUIModeNormal; + int mode = display.systemUIMode, options = display.systemUIOptions; if (fullScreen) { mode = OS.kUIModeAllHidden; if (menuBar != null) { mode = OS.kUIModeContentHidden; } + options = 0; } - int uiMode[] = new int[1]; - OS.GetSystemUIMode(uiMode, null); - if (uiMode[0] != mode) OS.SetSystemUIMode (mode, 0); + int[] uiMode = new int[1], uiOptions = new int[1]; + OS.GetSystemUIMode(uiMode, uiOptions); + if (uiMode[0] != mode || uiOptions[0] != options) OS.SetSystemUIMode (mode, options); if (fullScreen) window.setFrame(fullScreenFrame, true); } |