aboutsummaryrefslogtreecommitdiffstats
path: root/sdkmanager/libs
diff options
context:
space:
mode:
authorSiva Velusamy <vsiva@google.com>2011-10-05 17:04:55 -0700
committerRaphael <raphael@google.com>2011-10-12 12:02:56 -0700
commitb0f4e888025fbf2273bd25b130afe892e8b0d3ea (patch)
tree48571555d93664c6f3e928220c32d339815e0cfd /sdkmanager/libs
parentf6e87ad1622722c0067d19b4389ca4feb3fdd682 (diff)
downloadsdk-b0f4e888025fbf2273bd25b130afe892e8b0d3ea.zip
sdk-b0f4e888025fbf2273bd25b130afe892e8b0d3ea.tar.gz
sdk-b0f4e888025fbf2273bd25b130afe892e8b0d3ea.tar.bz2
SDK Manager: Remove APPLICATION_MODAL from shell style.
Have APPLICATION_MODAL causes the log window to never have focus. This patch has been tested only on Linux. Updated by Raphael: - Differentiate behavior for Linux. - Also apply to the AVD manager standalone window. Change-Id: Iff8461e26c3e36712083708969a781b9d5ed63c8
Diffstat (limited to 'sdkmanager/libs')
-rwxr-xr-xsdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/sdkman2/AvdManagerWindowImpl1.java15
-rwxr-xr-xsdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/sdkman2/SdkUpdaterWindowImpl2.java15
2 files changed, 28 insertions, 2 deletions
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/sdkman2/AvdManagerWindowImpl1.java b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/sdkman2/AvdManagerWindowImpl1.java
index 63224bd..0e5c3d0 100755
--- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/sdkman2/AvdManagerWindowImpl1.java
+++ b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/sdkman2/AvdManagerWindowImpl1.java
@@ -150,7 +150,20 @@ public class AvdManagerWindowImpl1 {
}
private void createShell() {
- mShell = new Shell(mParentShell, SWT.SHELL_TRIM | SWT.APPLICATION_MODAL);
+ // The AVD Manager must use a shell trim when standalone
+ // or a dialog trim when invoked from somewhere else.
+ int style = SWT.SHELL_TRIM;
+ if (mContext != AvdInvocationContext.STANDALONE) {
+ style = SWT.DIALOG_TRIM;
+ }
+ if (SdkConstants.currentPlatform() != SdkConstants.PLATFORM_LINUX ||
+ mContext != AvdInvocationContext.STANDALONE) {
+ // Ideally we want the window to be app-modal, but this prevents the
+ // log window from working properly on Linux so don't use the app modal
+ // flag if this is linux and the app is standalone.
+ style += SWT.APPLICATION_MODAL;
+ }
+ mShell = new Shell(mParentShell, style);
mShell.addDisposeListener(new DisposeListener() {
public void widgetDisposed(DisposeEvent e) {
ShellSizeAndPos.saveSizeAndPos(mShell, SIZE_POS_PREFIX);
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/sdkman2/SdkUpdaterWindowImpl2.java b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/sdkman2/SdkUpdaterWindowImpl2.java
index 89754e0..9385793 100755
--- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/sdkman2/SdkUpdaterWindowImpl2.java
+++ b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/sdkman2/SdkUpdaterWindowImpl2.java
@@ -165,7 +165,20 @@ public class SdkUpdaterWindowImpl2 implements ISdkUpdaterWindow {
}
private void createShell() {
- mShell = new Shell(mParentShell, SWT.SHELL_TRIM | SWT.APPLICATION_MODAL);
+ // The SDK Manager must use a shell trim when standalone
+ // or a dialog trim when invoked from somewhere else.
+ int style = SWT.SHELL_TRIM;
+ if (mContext != SdkInvocationContext.STANDALONE) {
+ style = SWT.DIALOG_TRIM;
+ }
+ if (SdkConstants.currentPlatform() != SdkConstants.PLATFORM_LINUX ||
+ mContext != SdkInvocationContext.STANDALONE) {
+ // Ideally we want the window to be app-modal, but this prevents the
+ // log window from working properly on Linux so don't use the app modal
+ // flag if this is linux and the app is standalone.
+ style += SWT.APPLICATION_MODAL;
+ }
+ mShell = new Shell(mParentShell, style);
mShell.addDisposeListener(new DisposeListener() {
public void widgetDisposed(DisposeEvent e) {
ShellSizeAndPos.saveSizeAndPos(mShell, SIZE_POS_PREFIX);