Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Williams2019-06-26 14:49:34 -0400
committerEric Williams2019-06-26 15:10:51 -0400
commit4f13ff5551300f17a97860a20c3b34c3aacd2917 (patch)
treef112442d42bf83e6069e604482ebe117ca8dd371
parent597c087433238a916123cfdb08f422f2bf6a44c2 (diff)
downloadeclipse.platform.swt-4f13ff5551300f17a97860a20c3b34c3aacd2917.tar.gz
eclipse.platform.swt-4f13ff5551300f17a97860a20c3b34c3aacd2917.tar.xz
eclipse.platform.swt-4f13ff5551300f17a97860a20c3b34c3aacd2917.zip
Bug 548628: Wayland as Input method is accessible in X11
Remove input method menu all together as GTK no longer supports it. Use the desktop environment input selection instead. Change-Id: I8519e7eb7111060f2c56f1da335a9115c7fd8983 Signed-off-by: Eric Williams <ericwill@redhat.com>
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c18
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c1
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h1
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GTK.java14
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/common_j2se/org/eclipse/swt/internal/SWTMessages.properties1
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Menu.java69
7 files changed, 0 insertions, 106 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c
index cff4af958e..dfab9f7cd9 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c
@@ -6829,24 +6829,6 @@ fail:
}
#endif
-#ifndef NO__1gtk_1im_1multicontext_1append_1menuitems
-JNIEXPORT void JNICALL GTK_NATIVE(_1gtk_1im_1multicontext_1append_1menuitems)
- (JNIEnv *env, jclass that, jlong arg0, jlong arg1)
-{
- GTK_NATIVE_ENTER(env, that, _1gtk_1im_1multicontext_1append_1menuitems_FUNC);
-/*
- gtk_im_multicontext_append_menuitems((GtkIMMulticontext *)arg0, (GtkMenuShell *)arg1);
-*/
- {
- GTK_LOAD_FUNCTION(fp, gtk_im_multicontext_append_menuitems)
- if (fp) {
- ((void (CALLING_CONVENTION*)(GtkIMMulticontext *, GtkMenuShell *))fp)((GtkIMMulticontext *)arg0, (GtkMenuShell *)arg1);
- }
- }
- GTK_NATIVE_EXIT(env, that, _1gtk_1im_1multicontext_1append_1menuitems_FUNC);
-}
-#endif
-
#ifndef NO__1gtk_1im_1multicontext_1new
JNIEXPORT jlong JNICALL GTK_NATIVE(_1gtk_1im_1multicontext_1new)
(JNIEnv *env, jclass that)
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c
index 5d197cffd2..8589c73125 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c
@@ -553,7 +553,6 @@ char * GTK_nativeFunctionNames[] = {
"_1gtk_1im_1context_1reset",
"_1gtk_1im_1context_1set_1client_1window",
"_1gtk_1im_1context_1set_1cursor_1location",
- "_1gtk_1im_1multicontext_1append_1menuitems",
"_1gtk_1im_1multicontext_1new",
"_1gtk_1image_1new",
"_1gtk_1image_1new_1from_1icon_1name___3B",
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h
index 064d2d514b..73994032b7 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h
@@ -551,7 +551,6 @@ typedef enum {
_1gtk_1im_1context_1reset_FUNC,
_1gtk_1im_1context_1set_1client_1window_FUNC,
_1gtk_1im_1context_1set_1cursor_1location_FUNC,
- _1gtk_1im_1multicontext_1append_1menuitems_FUNC,
_1gtk_1im_1multicontext_1new_FUNC,
_1gtk_1image_1new_FUNC,
_1gtk_1image_1new_1from_1icon_1name___3B_FUNC,
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GTK.java b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GTK.java
index f0aa896c3c..eae8f49f1e 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GTK.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GTK.java
@@ -3557,20 +3557,6 @@ public class GTK extends OS {
lock.unlock();
}
}
- /**
- * @method flags=dynamic
- * @param context cast=(GtkIMMulticontext *)
- * @param menushell cast=(GtkMenuShell *)
- */
- public static final native void _gtk_im_multicontext_append_menuitems (long context, long menushell);
- public static final void gtk_im_multicontext_append_menuitems (long context, long menushell) {
- lock.lock();
- try {
- _gtk_im_multicontext_append_menuitems(context, menushell);
- } finally {
- lock.unlock();
- }
- }
public static final native long _gtk_im_multicontext_new();
public static final long gtk_im_multicontext_new() {
lock.lock();
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/common_j2se/org/eclipse/swt/internal/SWTMessages.properties b/bundles/org.eclipse.swt/Eclipse SWT/common_j2se/org/eclipse/swt/internal/SWTMessages.properties
index c53d9af7b4..da86f4f1e8 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/common_j2se/org/eclipse/swt/internal/SWTMessages.properties
+++ b/bundles/org.eclipse.swt/Eclipse SWT/common_j2se/org/eclipse/swt/internal/SWTMessages.properties
@@ -58,7 +58,6 @@ SWT_Charset_Japanese=japanese
SWT_Charset_Korean=korean
SWT_Charset_Unicode=unicode
SWT_Charset_ASCII=ASCII
-SWT_InputMethods=Input Methods
SWT_Password=Password:
SWT_Username=User Name:
SWT_Switch=Switch
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java
index a5316e97f3..9fcdc2a649 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java
@@ -6280,8 +6280,6 @@ boolean showMenu (int x, int y, int detail) {
if (isDisposed ()) return false;
if (event.doit) {
if (menu != null && !menu.isDisposed ()) {
- boolean hooksKeys = hooks (SWT.KeyDown) || hooks (SWT.KeyUp);
- menu.createIMMenu (hooksKeys ? imHandle() : 0);
Rectangle rect = DPIUtil.autoScaleUp (event.getBounds ());
if (rect.x != x || rect.y != y) {
menu.setLocationInPixels (rect.x, rect.y);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Menu.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Menu.java
index 4b992d3786..0b3069344b 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Menu.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Menu.java
@@ -46,7 +46,6 @@ public class Menu extends Widget {
boolean hasLocation;
MenuItem cascade, selectedItem;
Decorations parent;
- long imItem, imSeparator, imHandle;
ImageList imageList;
int poppedUpCount;
@@ -411,67 +410,6 @@ void createHandle (int index) {
}
}
-void createIMMenu (long imHandle) {
- if (imHandle == 0) {
- this.imHandle = 0;
- if (imItem != 0) {
- GTK.gtk_widget_destroy (imItem);
- imItem = 0;
- }
- if (imSeparator != 0) {
- GTK.gtk_widget_destroy (imSeparator);
- imSeparator = 0;
- }
- return;
- }
- if (this.imHandle == imHandle) return;
- this.imHandle = imHandle;
-
- if (imSeparator == 0) {
- imSeparator = GTK.gtk_separator_menu_item_new ();
- GTK.gtk_widget_show (imSeparator);
- GTK.gtk_menu_shell_insert (handle, imSeparator, -1);
- }
- if (imItem == 0) {
- byte[] buffer = Converter.wcsToMbcs (SWT.getMessage("SWT_InputMethods"), true);
- imItem = GTK.gtk_menu_item_new ();
- if (imItem == 0) error (SWT.ERROR_NO_HANDLES);
- long imageHandle = 0;
- long labelHandle = GTK.gtk_accel_label_new (buffer);
- if (labelHandle == 0) error (SWT.ERROR_NO_HANDLES);
- if (GTK.GTK_VERSION >= OS.VERSION (3, 16, 0)) {
- GTK.gtk_label_set_xalign (labelHandle, 0);
- GTK.gtk_widget_set_halign (labelHandle, GTK.GTK_ALIGN_FILL);
- } else {
- GTK.gtk_misc_set_alignment(labelHandle, 0, 0);
- }
- long boxHandle = gtk_box_new (GTK.GTK_ORIENTATION_HORIZONTAL, false, 0);
- if (boxHandle == 0) error (SWT.ERROR_NO_HANDLES);
- if (OS.SWT_PADDED_MENU_ITEMS) {
- imageHandle = GTK.gtk_image_new();
- if (imageHandle == 0) error (SWT.ERROR_NO_HANDLES);
- GTK.gtk_image_set_pixel_size (imageHandle, 16);
- if (boxHandle != 0) {
- GTK.gtk_container_add (boxHandle, imageHandle);
- GTK.gtk_widget_show (imageHandle);
- }
- }
- if (labelHandle != 0 && boxHandle != 0) {
- gtk_box_pack_end (boxHandle, labelHandle, true, true, 0);
- GTK.gtk_widget_show (labelHandle);
- }
- if (boxHandle != 0) {
- GTK.gtk_container_add (imItem, boxHandle);
- GTK.gtk_widget_show (boxHandle);
- }
- GTK.gtk_widget_show (imItem);
- GTK.gtk_menu_shell_insert (handle, imItem, -1);
- }
- long imSubmenu = GTK.gtk_menu_new ();
- GTK.gtk_im_multicontext_append_menuitems (imHandle, imSubmenu);
- GTK.gtk_menu_item_set_submenu (imItem, imSubmenu);
-}
-
@Override
void createWidget (int index) {
checkOrientation (parent);
@@ -570,8 +508,6 @@ public MenuItem getItem (int index) {
long list = GTK.gtk_container_get_children (handle);
if (list == 0) error (SWT.ERROR_CANNOT_GET_ITEM);
int count = OS.g_list_length (list);
- if (imSeparator != 0) count--;
- if (imItem != 0) count--;
if (!(0 <= index && index < count)) error (SWT.ERROR_INVALID_RANGE);
long data = OS.g_list_nth_data (list, index);
OS.g_list_free (list);
@@ -595,8 +531,6 @@ public int getItemCount () {
if (list == 0) return 0;
int count = OS.g_list_length (list);
OS.g_list_free (list);
- if (imSeparator != 0) count--;
- if (imItem != 0) count--;
return Math.max (0, count);
}
@@ -622,8 +556,6 @@ public MenuItem [] getItems () {
if (list == 0) return new MenuItem [0];
long originalList = list;
int count = OS.g_list_length (list);
- if (imSeparator != 0) count--;
- if (imItem != 0) count--;
MenuItem [] items = new MenuItem [count];
int index = 0;
for (int i=0; i<count; i++) {
@@ -963,7 +895,6 @@ void releaseWidget () {
if (parent != null) parent.removeMenu (this);
parent = null;
cascade = null;
- imItem = imSeparator = imHandle = 0;
if (imageList != null) imageList.dispose ();
imageList = null;
}

Back to the top