diff options
author | Kevin Barnes <krbarnes> | 2007-08-20 15:48:22 +0000 |
---|---|---|
committer | Kevin Barnes <krbarnes> | 2007-08-20 15:48:22 +0000 |
commit | 955ded925bcf4c3ba45151b68377c60c954193fe (patch) | |
tree | 44e040a3811a0fc2dbf7469e147b26a09f436fc7 | |
parent | 62f2681315cc0e80ec3909eda5f6ad70fcc9b50f (diff) | |
download | eclipse.platform.swt-955ded925bcf4c3ba45151b68377c60c954193fe.tar.gz eclipse.platform.swt-955ded925bcf4c3ba45151b68377c60c954193fe.tar.xz eclipse.platform.swt-955ded925bcf4c3ba45151b68377c60c954193fe.zip |
Bug 196979 - Shell.getBounds() wrong when shell is maximized.
6 files changed, 26 insertions, 6 deletions
diff --git a/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/org.eclipse.swt.internal.wpf.OS.properties b/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/org.eclipse.swt.internal.wpf.OS.properties index 89d9e82d10..7c79514cf7 100644 --- a/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/org.eclipse.swt.internal.wpf.OS.properties +++ b/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/org.eclipse.swt.internal.wpf.OS.properties @@ -3336,6 +3336,9 @@ OS_UIElement_RemoveHandler_0=cast=UIElement^,flags=gcobject OS_UIElement_RemoveHandler_1=cast=RoutedEvent^,flags=gcobject OS_UIElement_RemoveHandler_2=cast=Delegate^,flags=gcobject +OS_UIElement_RenderSize=flags=gcobject getter +OS_UIElement_RenderSize_0=cast=UIElement^,flags=gcobject + OS_UIElement_SnapsToDevicePixels=flags=setter OS_UIElement_SnapsToDevicePixels_0=cast=UIElement^,flags=gcobject OS_UIElement_SnapsToDevicePixels_1= diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/wpf/library/os.cpp b/bundles/org.eclipse.swt/Eclipse SWT PI/wpf/library/os.cpp index 493a2717e7..6654e22c5e 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/wpf/library/os.cpp +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/wpf/library/os.cpp @@ -12245,6 +12245,19 @@ JNIEXPORT void JNICALL OS_NATIVE(UIElement_1RemoveHandler) } #endif +#ifndef NO_UIElement_1RenderSize +extern "C" JNIEXPORT jint JNICALL OS_NATIVE(UIElement_1RenderSize)(JNIEnv *env, jclass that, jint arg0); +JNIEXPORT jint JNICALL OS_NATIVE(UIElement_1RenderSize) + (JNIEnv *env, jclass that, jint arg0) +{ + jint rc = 0; + OS_NATIVE_ENTER(env, that, UIElement_1RenderSize_FUNC); + rc = (jint)TO_HANDLE(((UIElement^)TO_OBJECT(arg0))->RenderSize); + OS_NATIVE_EXIT(env, that, UIElement_1RenderSize_FUNC); + return rc; +} +#endif + #ifndef NO_UIElement_1SnapsToDevicePixels extern "C" JNIEXPORT void JNICALL OS_NATIVE(UIElement_1SnapsToDevicePixels)(JNIEnv *env, jclass that, jint arg0, jboolean arg1); JNIEXPORT void JNICALL OS_NATIVE(UIElement_1SnapsToDevicePixels) diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/wpf/library/os_stats.cpp b/bundles/org.eclipse.swt/Eclipse SWT PI/wpf/library/os_stats.cpp index 18cbb65925..e55ad1b950 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/wpf/library/os_stats.cpp +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/wpf/library/os_stats.cpp @@ -14,8 +14,8 @@ #ifdef NATIVE_STATS -int OS_nativeFunctionCount = 1273; -int OS_nativeFunctionCallCount[1273]; +int OS_nativeFunctionCount = 1274; +int OS_nativeFunctionCallCount[1274]; char * OS_nativeFunctionNames[] = { "AccessText_1AccessKey", "AccessText_1Text", @@ -1032,6 +1032,7 @@ char * OS_nativeFunctionNames[] = { "UIElement_1QueryContinueDragEvent", "UIElement_1ReleaseMouseCapture", "UIElement_1RemoveHandler", + "UIElement_1RenderSize", "UIElement_1SnapsToDevicePixels", "UIElement_1TextInput", "UIElement_1TranslatePoint", diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/wpf/library/os_stats.h b/bundles/org.eclipse.swt/Eclipse SWT PI/wpf/library/os_stats.h index b24de93f92..8db422671c 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/wpf/library/os_stats.h +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/wpf/library/os_stats.h @@ -1040,6 +1040,7 @@ typedef enum { UIElement_1QueryContinueDragEvent_FUNC, UIElement_1ReleaseMouseCapture_FUNC, UIElement_1RemoveHandler_FUNC, + UIElement_1RenderSize_FUNC, UIElement_1SnapsToDevicePixels_FUNC, UIElement_1TextInput_FUNC, UIElement_1TranslatePoint_FUNC, diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/wpf/org/eclipse/swt/internal/wpf/OS.java b/bundles/org.eclipse.swt/Eclipse SWT PI/wpf/org/eclipse/swt/internal/wpf/OS.java index af735eb0e5..be0580ea79 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/wpf/org/eclipse/swt/internal/wpf/OS.java +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/wpf/org/eclipse/swt/internal/wpf/OS.java @@ -1416,6 +1416,7 @@ public static final native void UIElement_LostKeyboardFocus(int sender, int hand public static final native void UIElement_PreviewTextInput(int sender, int handler); public static final native void UIElement_QueryContinueDrag(int sender, int handler); public static final native int UIElement_QueryContinueDragEvent(); +public static final native int UIElement_RenderSize(int sender); public static final native void UIElement_ReleaseMouseCapture(int sender); public static final native void UIElement_RemoveHandler(int sender, int routedEvent, int handler); public static final native void UIElement_SnapsToDevicePixels(int sender, boolean value); diff --git a/bundles/org.eclipse.swt/Eclipse SWT/wpf/org/eclipse/swt/widgets/Shell.java b/bundles/org.eclipse.swt/Eclipse SWT/wpf/org/eclipse/swt/widgets/Shell.java index 8794737086..d9d01cfaad 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/wpf/org/eclipse/swt/widgets/Shell.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/wpf/org/eclipse/swt/widgets/Shell.java @@ -10,7 +10,6 @@ *******************************************************************************/ package org.eclipse.swt.widgets; - import org.eclipse.swt.internal.wpf.*; import org.eclipse.swt.internal.win32.*; import org.eclipse.swt.*; @@ -617,8 +616,10 @@ public Rectangle getBounds () { x = (int) OS.Window_Left (shellHandle); y = (int) OS.Window_Top (shellHandle); } - int width = (int) OS.FrameworkElement_Width (shellHandle); - int height = (int) OS.FrameworkElement_Height (shellHandle); + int renderSize = OS.UIElement_RenderSize (shellHandle); + int width = (int) OS.Size_Width (renderSize); + int height = (int) OS.Size_Height (renderSize); + OS.GCHandle_Free (renderSize); return new Rectangle (x, y, width, height); } @@ -1137,7 +1138,7 @@ public void setFullScreen (boolean fullScreen) { oldWindowState = OS.Window_WindowState (shellHandle); OS.Window_Hide (shellHandle); OS.Window_WindowStyle (shellHandle, OS.WindowStyle_None); - OS.Window_Show (shellHandle); + if (getVisible ()) OS.Window_Show (shellHandle); OS.Window_WindowState (shellHandle, OS.WindowState_Maximized); } else { OS.Window_WindowStyle (shellHandle, oldWindowStyle); |