Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNikita Nemkin2020-01-22 08:04:57 +0000
committerNiraj Modi2020-01-22 09:11:00 +0000
commita103d4913617daefa408f870c34aea9db6d40b37 (patch)
treeaef05ecb22e14fca1b80c739a02f3af1c078e41f /bundles
parent7983a1111c31c81e4fa51d873e5669e64a590e8c (diff)
downloadeclipse.platform.swt-a103d4913617daefa408f870c34aea9db6d40b37.tar.gz
eclipse.platform.swt-a103d4913617daefa408f870c34aea9db6d40b37.tar.xz
eclipse.platform.swt-a103d4913617daefa408f870c34aea9db6d40b37.zip
Bug 543747 - [Win32] JVM crash after connecting Windows Remote Desktop
Remove per-shell IMM context creation and propagation to work around Windows bug. Remove obsolete workaround for Bug 14656 (IME window doesn't close on shell deactivation). Shell.setImeInputMode effect becomes global, instead of per-shell. Change-Id: Icd3b8946fa87a87207a9cc41c29a71dd3e5bb069 Signed-off-by: Niraj Modi <niraj.modi@in.ibm.com>
Diffstat (limited to 'bundles')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java11
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Shell.java30
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Spinner.java12
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Tree.java8
4 files changed, 7 insertions, 54 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java
index 743540a039..ad79b41406 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2018 IBM Corporation and others.
+ * Copyright (c) 2000, 2020 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -722,12 +722,6 @@ void createHandle () {
if ((bits & OS.WS_CHILD) != 0) {
OS.SetWindowLongPtr (handle, OS.GWLP_ID, handle);
}
- if (OS.IsDBLocale && hwndParent != 0) {
- long /*int*/ hIMC = OS.ImmGetContext (hwndParent);
- OS.ImmAssociateContext (handle, hIMC);
- OS.ImmReleaseContext (hwndParent, hIMC);
- }
-
}
void checkGesture () {
@@ -2545,9 +2539,6 @@ void releaseParent () {
@Override
void releaseWidget () {
super.releaseWidget ();
- if (OS.IsDBLocale) {
- OS.ImmAssociateContext (handle, 0);
- }
if (toolTipText != null) {
setToolTipText (getShell (), null);
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Shell.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Shell.java
index 4d5c2d3294..578de4b93e 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Shell.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Shell.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2016 IBM Corporation and others.
+ * Copyright (c) 2000, 2020 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -123,7 +123,7 @@ import org.eclipse.swt.internal.win32.*;
public class Shell extends Decorations {
Menu activeMenu;
ToolTip [] toolTips;
- long /*int*/ hIMC, hwndMDIClient, lpstrTip, toolTipHandle, balloonTipHandle, menuItemToolTipHandle;
+ long /*int*/ hwndMDIClient, lpstrTip, toolTipHandle, balloonTipHandle, menuItemToolTipHandle;
int minWidth = SWT.DEFAULT, minHeight = SWT.DEFAULT;
long /*int*/ [] brushes;
boolean showWithParent, fullScreen, wasMaximized, modified, center;
@@ -625,10 +625,6 @@ void createHandle () {
int flags = OS.SWP_DRAWFRAME | OS.SWP_NOMOVE | OS.SWP_NOSIZE | OS.SWP_NOZORDER | OS.SWP_NOACTIVATE;
OS.SetWindowPos (handle, 0, 0, 0, 0, 0, flags);
}
- if (OS.IsDBLocale) {
- hIMC = OS.ImmCreateContext ();
- if (hIMC != 0) OS.ImmAssociateContext (handle, hIMC);
- }
}
void createMenuItemToolTipHandle() {
@@ -712,16 +708,6 @@ void destroyToolTip (ToolTip toolTip) {
void destroyWidget () {
fixActiveShell ();
super.destroyWidget ();
-
- /*
- * Destroy context only after the controls that used it were destroyed.
- * Technically, that shouldn't be necessary, because 'Control.releaseWidget'
- * clears up association by calling 'OS.ImmAssociateContext (handle, 0)'.
- * However, there's a bug in Windows 10 (see bug 526758), and this is the workaround.
- */
- if (OS.IsDBLocale) {
- if (hIMC != 0) OS.ImmDestroyContext (hIMC);
- }
}
@Override
@@ -2176,18 +2162,6 @@ int widgetStyle () {
@Override
LRESULT WM_ACTIVATE (long /*int*/ wParam, long /*int*/ lParam) {
- /*
- * Bug in Windows XP. When a Shell is deactivated, the
- * IME composition window does not go away. This causes
- * repaint issues. The fix is to commit the composition
- * string.
- */
- if (OS.LOWORD (wParam) == 0 && OS.IsDBLocale && hIMC != 0) {
- if (OS.ImmGetOpenStatus (hIMC)) {
- OS.ImmNotifyIME (hIMC, OS.NI_COMPOSITIONSTR, OS.CPS_COMPLETE, 0);
- }
- }
-
/* Process WM_ACTIVATE */
LRESULT result = super.WM_ACTIVATE (wParam, lParam);
if (OS.LOWORD (wParam) == 0) {
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Spinner.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Spinner.java
index 4d112577c8..76cfc7ce95 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Spinner.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Spinner.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2012 IBM Corporation and others.
+ * Copyright (c) 2000, 2020 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -15,9 +15,9 @@ package org.eclipse.swt.widgets;
import org.eclipse.swt.*;
-import org.eclipse.swt.internal.win32.*;
-import org.eclipse.swt.graphics.*;
import org.eclipse.swt.events.*;
+import org.eclipse.swt.graphics.*;
+import org.eclipse.swt.internal.win32.*;
/**
* Instances of this class are selectable user interface
@@ -187,12 +187,6 @@ void createHandle () {
int flags = OS.SWP_NOSIZE | OS.SWP_NOMOVE | OS.SWP_NOACTIVATE;
OS.SetWindowPos (hwndText, hwndUpDown, 0, 0, 0, 0, flags);
OS.SetWindowLongPtr (hwndUpDown, OS.GWLP_ID, hwndUpDown);
- if (OS.IsDBLocale) {
- long /*int*/ hIMC = OS.ImmGetContext (handle);
- OS.ImmAssociateContext (hwndText, hIMC);
- OS.ImmAssociateContext (hwndUpDown, hIMC);
- OS.ImmReleaseContext (handle, hIMC);
- }
OS.SendMessage (hwndUpDown, OS.UDM_SETRANGE32, 0, 100);
OS.SendMessage (hwndUpDown, OS.UDM_SETPOS32, 0, 0);
pageIncrement = 10;
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Tree.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Tree.java
index 7c16faa14e..4bf052dafd 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Tree.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Tree.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2018 IBM Corporation and others.
+ * Copyright (c) 2000, 2020 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -2266,12 +2266,6 @@ void createParent () {
null);
if (hwndHeader == 0) error (SWT.ERROR_NO_HANDLES);
OS.SetWindowLongPtr (hwndHeader, OS.GWLP_ID, hwndHeader);
- if (OS.IsDBLocale) {
- long /*int*/ hIMC = OS.ImmGetContext (handle);
- OS.ImmAssociateContext (hwndParent, hIMC);
- OS.ImmAssociateContext (hwndHeader, hIMC);
- OS.ImmReleaseContext (handle, hIMC);
- }
//This code is intentionally commented
// if (!OS.IsPPC) {
// if ((style & SWT.BORDER) != 0) {

Back to the top